最佳答案:
GetWindowRect是一个Windows API函数。该函数返回指定窗口的边框矩形的大小,函数原型为void GetWindowRect(LPRECT lpRect) const。
详情介绍
GetWindowRect是一个Windows API函数。该函数返回指定窗口的边框矩形的大小,函数原型为void GetWindowRect(LPRECT lpRect) const。

- 中文名
- GetWindowRect
- 外文名
- GetWindowRect
- hWnd
- 窗口句柄
- Windows NT
- 3.1以上版本
- Windows
- 2000以上版本
GetWindowRect函数功能
该函数返回指定窗口的边框矩形的尺寸。该尺寸以相对于屏幕坐标左上角的屏幕坐标给出。
GetWindowRect函数原型
BOOL GetWindowRect(HWND hWnd,LPRECT lpRect);
在Visual Studio 2005中,函数原型为void GetWindowRect(LPRECT lpRect) const;
是属于CWnd类的函数.
GetWindowRect参数
hWnd:窗口句柄。
lpRect:指向一个RECT结构的指针,该结构接收窗口的左上角和右下角的屏幕坐标。

GetWindowRect变量
left ;top; right;bottom;
分别表示该窗口的/左侧/顶部/右侧/底部坐标
GetWindowRect返回值
如果函数成功,返回值为非零:如果函数失败,返回值为零。若想获得更多错误信息,请调用GetLastError函数。
GetWindowRect速查
Windows NT:3.1以上版本:Windows:95以上版本;Windows CE:1.0以上版本;头文件:Windows.h;库文件:User32.lib。
GetWindowRect声明
VB.NET 声明
Public Declare Function GetWindowRect Lib "user32.dll" (ByVal hwnd As IntPtr, <MarshalAs(UnmanagedType.LPStruct)>ByRef lpRect As RECT) As <MarshalAs(UnmanagedType.I4)>Boolean
Public Structure RECT

<MarshalAs(UnmanagedType.I4)> Public left As Integer
<MarshalAs(UnmanagedType.I4)> Public top As Integer
<MarshalAs(UnmanagedType.I4)> Public right As Integer
<MarshalAs(UnmanagedType.I4)> Public bottom As Integer
End Structure


