getclientrect,getwindowrect函数

来源:百度知道 编辑:UC知道 时间:2024/05/20 01:28:44
这2个函数怎么使用呢,谁能举个简单例子?
返回值是什么,得到的返回值能用?
谢谢,能不能举个小例子。
比如说把当前窗口坐标得到,然后输出。

CWnd::GetClientRect
This method copies the client coordinates of the CWnd client area into the structure pointed to by lpRect. The client coordinates specify the upper-left and lower-right corners of the client area. Since client coordinates are relative to the upper-left corners of the CWnd client area, the coordinates of the upper-left corner are (0,0).

void GetClientRect(
LPRECT lpRect )
const;
Parameters
lpRect
Points to a RECT structure or a CRect object to receive the client coordinates. The left and top members will be zero. The right and bottom members will contain the width and height of the window.
Example
This is the example from the CWnd::IsIconic method.

// This code, normally emitted by the AppWizard for a dialog-based
// project for the dialog's WM_PAINT handler, it runs only if the
// window is iconic. The window erases the icon's area, then
// paints the icon referenced by m_h