Windows XP GetWindowRect

Joined
Jul 11, 2009
Messages
5
Reaction score
0
What is the correct syntax for GetWindowRect API function with XP?
Please help me.
Thanks in advance,
Er.S.M.M.Hanifa
 
What is there to get?

the information inside MSDN

GetWindowRect
The GetWindowRect function retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.

BOOL GetWindowRect(
HWND hWnd, // handle to window
LPRECT lpRect // window coordinates
);
Parameters
hWnd
[in] Handle to the window.
lpRect
[out] Pointer to a RECT structure that receives the screen coordinates of the upper-left and lower-right corners of the window.
 
In VB6, it is stated as below in API viewer:
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Public Declare Function GetWindowRect Lib "user32" Alias "GetWindowRect" (ByVal hwnd As Long, lpRect As RECT) As Long
It works well with win-98 but it gives error in XP.
How I insert your statements?
Please furnish me the correct syntax.
Thanks,
Er.S.M.M.Hanifa
 
What's the error message in WinXp?

hanifasmm said:
In VB6, it is stated as below in API viewer:
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Public Declare Function GetWindowRect Lib "user32" Alias "GetWindowRect" (ByVal hwnd As Long, lpRect As RECT) As Long
It works well with win-98 but it gives error in XP.
How I insert your statements?
Please furnish me the correct syntax.
Thanks,
Er.S.M.M.Hanifa
 
In my program, I defined Getfocus and GetWindowRect of API.
For GetFocus, I am receivig erro message: Run-time error '6' : overflow.
For GetWindowRect, Error7: out of memory.
If I run in VP6 as project1, I get error in log-fike.
It states as follows:
Line 14: Property OleObjectBlob in DBGri1 could not be set.
Line 14: Property Bindings in DBGri1 could not be set.
Line 14: Cannot load control DBGri1.
Note DBGri1 is the name I have give for
sub routine which uses GetWindowRect.
Please give me correct syntax for both
Getfocus and GetWindowRect of API to run in XP-32 bit.
Note: This program works well in win98 for the last 5 years.
Thanks,
Er.S.M.M.Hanifa
 
Back
Top