'Get window position points using GetWindowRect API
'Get window position points using GetWindowRect API
API Declarations
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function GetForegroundWindow Lib "user32" () As Long
Rate 'Get window position points using GetWindowRect API
(1(1 Vote))
'http://www.geocities.com/marskarthik
'http://marskarthik.virtualave.net
'Email: [email protected]
Private Sub Form_Load()
SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, 1
End Sub
Private Sub Timer1_Timer()
Dim wnrect As RECT
GetWindowRect GetForegroundWindow(), wnrect
Label1.Caption = "Top = " & wnrect.Top & " " & "Left = " & wnrect.Left & _
Chr(13) & "Bottom = " & wnrect.Bottom & " " & "Right = " & wnrect.Right
End Sub
'Get window position points using GetWindowRect API Comments
No comments yet — be the first to post one!
Post a Comment