Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As Long, lpdwProcessId As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Public Sub GetWindowsRECT(hWnd As Long, ProcID As Integer, Height As Integer, Top As Integer, Left As Integer, Witch As Integer)
'Возвращает информацию о окне: кординаты, высоту, ширину
Dim rctTemp As RECT
GetWindowThreadProcessId hWnd, lngProcID
GetWindowRect hWnd, rctTemp
'Load the labels with the info retrieved.
ProcID = lngProcID
Top = rctTemp.Top
Left = rctTemp.Left
Height = rctTemp.Bottom - Top
Witch = rctTemp.Right - Left
End Sub
Ответить
|