- 'Dans une forme
- Const ABM_GETTASKBARPOS = &H5
- Private Type RECT
- Left As Long
- Top As Long
- Right As Long
- Bottom As Long
- End Type
- Private Type APPBARDATA
- cbSize As Long
- hwnd As Long
- uCallbackMessage As Long
- uEdge As Long
- rc As RECT
- lParam As Long
- End Type
- Private Declare Function SHAppBarMessage Lib "shell32.dll" (ByVal dwMessage As Long, pData As APPBARDATA) As Long
-
- Private Sub Command1_Click()
- Dim ABD As APPBARDATA, Ret As Long
- SHAppBarMessage ABM_GETTASKBARPOS, ABD
- Command1.Caption = (ABD.rc.Bottom - ABD.rc.Top) * 13.5
- End Sub
-
- Private Sub Command2_Click()
- Dim ABD As APPBARDATA, Ret As Long
- SHAppBarMessage ABM_GETTASKBARPOS, ABD
- Form1.Top = (Screen.Height - Form1.Height) - (ABD.rc.Bottom - ABD.rc.Top) * 13.5
- End Sub
'Dans une forme
Const ABM_GETTASKBARPOS = &H5
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type APPBARDATA
cbSize As Long
hwnd As Long
uCallbackMessage As Long
uEdge As Long
rc As RECT
lParam As Long
End Type
Private Declare Function SHAppBarMessage Lib "shell32.dll" (ByVal dwMessage As Long, pData As APPBARDATA) As Long
Private Sub Command1_Click()
Dim ABD As APPBARDATA, Ret As Long
SHAppBarMessage ABM_GETTASKBARPOS, ABD
Command1.Caption = (ABD.rc.Bottom - ABD.rc.Top) * 13.5
End Sub
Private Sub Command2_Click()
Dim ABD As APPBARDATA, Ret As Long
SHAppBarMessage ABM_GETTASKBARPOS, ABD
Form1.Top = (Screen.Height - Form1.Height) - (ABD.rc.Bottom - ABD.rc.Top) * 13.5
End Sub