kiki29 | Peut-être ceci
Dans un module
Option Explicit
Private Declare Function ShowWindow Lib "user32" _
(ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" _
Alias "FindWindowExA" (ByVal hWnd1 As Long, _
ByVal hWnd2 As Long, _
ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Long
Sub TaskBar(bValue As Boolean)
Dim lHandle As Long
lHandle = FindWindow("Shell_TrayWnd", "" )
If bValue Then
ShowWindow lHandle, 5
Else
ShowWindow lHandle, 0
End If
End Sub
|
Dans une Form
Option Explicit
Private Sub Command1_Click()
TaskBar True
End Sub
Private Sub Command2_Click()
TaskBar False
End Sub
|
Sinon plus concis
Dans Module
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) 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 Const SWP_HIDEWINDOW As Long = &H80
Private Const SWP_SHOWWINDOW As Long = &H40
|
Dans Form
Option Explicit
Private Sub Command1_Click()
Dim hwnd As Long
hwnd = FindWindow("Shell_traywnd", "" )
SetWindowPos hwnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW
End Sub
Private Sub Command2_Click()
Dim hwnd As Long
hwnd = FindWindow("Shell_traywnd", "" )
SetWindowPos hwnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW
End Sub
|
Message édité par kiki29 le 29-03-2007 à 20:58:43
|