|
-
Feb 26th, 2003, 04:40 PM
#1
Thread Starter
Junior Member
Top window location
Hi,
I have a application which move the cursor to a web page button (x, y) and click to open a new page window (samll window). Then move cursor to a button on this new page and click. But how to located new top small window's (0, 0)? because it is not at same popup location each time. Thank you so much.
-
Feb 27th, 2003, 07:44 AM
#2
Lively Member
hi!!
here is some code to determine the location and size of
the foregroundwindow...
Private Declare Function GetWindowRect Lib "user32.dll" (ByVal hWnd As Long, lpRect As RECT) As Long
Private Declare Function GetForegroundWindow Lib "user32.dll" () As Long
Private Type RECT
left As Long
top As Long
right As Long
bottom As Long
End Type
Private Sub Timer1_Timer()
Dim r As RECT
Dim hWnd As Long
Dim ret As Long
hWnd = GetForegroundWindow()
ret = GetWindowRect(hWnd, r)
Label1.Caption = "Left=" & r.left
Label2.Caption = "right=" & r.right
Label3.Caption = "top=" & r.top
Label4.Caption = "bottom=" & r.bottom
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|