15,979
社区成员
发帖
与我相关
我的任务
分享
void CMonitrSymDlg::ResetViewDialog()
{
CRect rect, rc, r;
int i, j;
int x, y, cx, cy;
GetDlgItem(IDC_DRAW)->GetWindowRect(rect);
ScreenToClient(rect);
rect.DeflateRect(1, 18, 1, 1);
if( MAX_WINDOWS_NUM == 4 )
{
x = rect.left;
y = rect.top;
cx = ( rect.Width() - 2 ) / 2;
cy = ( rect.Height() - 2 ) / 2;
for( i=0; i<2; i++ )
{
x = rect.left;
for( j=0; j<2; j++ )
{
rc.left = x;
rc.top = y;
rc.right = rc.left + cx;
rc.bottom = rc.top + cy;
r = rc;
r.bottom = r.top + 18;
GetDlgItem(IDC_TITLE1+j+i*2)->MoveWindow(r, TRUE);
r.top = r.bottom + 1;
r.bottom = rc.bottom;
GetDlgItem(IDC_DISP_1+j+i*2)->MoveWindow(r, TRUE);
x += ( cx + 2 );
}
y += ( cy + 2 );
}
}
}
CMonitrSymDlg *pDlg = (CMonitrSymDlg *)GetParent();
pDlg->Invalidate();
谢谢两位了!!
LRESULT im_message_ui::OnCommand(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
UINT uCmdType = (UINT)wParam;
switch(uCmdType)
{
case SC_MAXIMIZE:
DefWindowProc( WM_SYSCOMMAND,SC_MAXIMIZE,0 );
break;
case SC_RESTORE:
DefWindowProc( WM_SYSCOMMAND,SC_RESTORE,0 );
break;
default:
bHandled=FALSE;
break;
}
Invalidate();//执行默认函数之后 刷新整个界面
return true;
}