1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| Option Explicit
Private Type RECT
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 FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Const HWND_BOTTOM = 1
Private Const SWP_NOSIZE = &H1
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 Sub Command1_Click()
Dim hIE As Long
Dim lSetPos As Long
Dim lGetRect As Long
Dim rectIE As RECT
hIE = FindWindow("IEFrame", vbNullString)
If hIE <> 0 Then
lGetRect = GetWindowRect(hIE, rectIE)
Debug.Print "Dimension Initiale Top" & rectIE.Top & " / Botton : " & rectIE.Bottom & " / Left : " & rectIE.Left & " / Right : " & rectIE.Right
Stop
lSetPos = SetWindowPos(hIE, HWND_BOTTOM, rectIE.Left, rectIE.Top, rectIE.Right - rectIE.Left, rectIE.Bottom - rectIE.Top, 0)
'A voir lGetRect et lSetPos doivent être 1 pour OK ..
Else
MsgBox "Fenêtre IE introuvable"
End If
End Sub |
Partager