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
Sub Auto_Open()
Dim hwnd As Long
hwnd = FindWindow("Shell_traywnd", "" )
SetWindowPos hwnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW
Application.DisplayFullScreen = True
End Sub
Sub Auto_Close()
Dim hwnd As Long
hwnd = FindWindow("Shell_traywnd", "" )
SetWindowPos hwnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW
Application.DisplayFullScreen = False
End Sub
|