-
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.
-
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