getwindowrect

目录导航

函数原型

BOOL GetWindowRect(HWND hWnd,LPRECT lpRect);

在Visual Studio 2005中,函数原型为void GetWindowRect(LPRECT lpRect) const;

是属于CWnd类的函数.

函数作用

该函数返回指定窗口的边框矩形的尺寸。该尺寸以相对于屏幕坐标左上角的屏幕坐标给出。

函数参数

hWnd:窗口句柄。

lpRect:指向一个RECT结构的指针,该结构接收窗口的左上角和右下角的屏幕坐标。

函数变量

left ;top; right;bottom;

分别表示该窗口的/左侧/顶部/右侧/底部坐标

返回值

如果函数成功,返回值为非零:如果函数失败,返回值为零。若想获得更多错误信息,请调用GetLastError函数。

速查方法

Windows NT:3.1以上版本:Windows:95以上版本;Windows CE:1.0以上版本;头文件:Winuser.h;库文件:User32.lib。

系统声明

vbdotnet声明

Private Declare Function GetWindowRect Lib "user32" Alias "GetWindowRect" (ByVal hwnd As Integer, ByRef lpRect As RECT) As Integer

Private Structure RECT

Dim left As Integer

Dim top As Integer

Dim right As Integer

Dim bottom As Integer

End Structure

相关百科
返回顶部
产品求购 求购