读书人

怎么把当前窗口的rect变为屏幕的rect

发布时间: 2012-03-22 17:43:57 作者: rapoo

如何把当前窗口的rect变为屏幕的rect
问题如题目

[解决办法]
The ClientToScreen member function assumes that the given point or rectangle is in client coordinates.

Example

// resize dialog to client's size
void CAboutDlg::OnButton1()
{
CRect myRect;
GetClientRect(&myRect);

ClientToScreen(myRect);
MoveWindow(myRect.left, myRect.top,
myRect.Width(), myRect.Height());
}


[解决办法]

C/C++ code
::MapWindowPoints(hWnd, NULL, (LPPOINT)&rcBound, sizeof (RECT) / sizeof (POINT));
[解决办法]
探讨

能转换rect吗?给个例子,那个是转换cpoint的

[解决办法]
探讨
C/C++ code
::MapWindowPoints(hWnd, NULL, (LPPOINT)&rcBound, sizeof (RECT) / sizeof (POINT));

[解决办法]
探讨

能转换rect吗?给个例子,那个是转换cpoint的

读书人网 >VC/MFC

热点推荐