15,979
社区成员
发帖
与我相关
我的任务
分享
void WinDoButtonOK(HWND hwnd)
{
RECT rtFrame,rtView;
HWND hFrame,hView;
hFrame = GetDlgItem(hwnd,IDC_FRAME);
hView = GetDlgItem(hwnd,IDC_LISTVIEW);
GetClientRect(hFrame,&rtFrame);
POINT pt;
pt.x = rtFrame.left;
pt.y= rtFrame.top;
ClientToScreen(hFrame,&pt);
MoveWindow(hView,pt.x,pt.y,rtFrame.right,rtFrame.bottom,TRUE);
}
CRect myRect;
GetClientRect(&myRect);
ClientToScreen(myRect);
MoveWindow(myRect.left, myRect.top,
myRect.Width(), myRect.Height());
可能是MFC类自己已经转换过了。CRect myRect;
HWND hBorder = GetDlgItem(hwnd,GUIDE_STATIC_BORDER);
GetClientRect(hBorder,&myRect);
ClientToScreen(myRect);
MoveWindow(hDLG[0],myRect.left, myRect.top,myRect.Width(), myRect.Height(),TRUE);