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
| 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 StartButton(blnValue As Boolean)
Dim lngHandle As Long
Dim lngStartButton As Long
lngHandle = FindWindow("Shell_TrayWnd", "")
lngStartButton = FindWindowEx(lngHandle, 0, "Button", vbNullString)
If blnValue Then
ShowWindow lngStartButton, 5
Else
ShowWindow lngStartButton, 0
End If
End Sub
Private Sub Command1_Click()
StartButton (True)
End Sub
Private Sub Command2_Click()
StartButton (False)
End Sub |
Partager