Option Explicit
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
Private Declare Function ShowWindow _
Lib "user32" ( _
ByVal hwnd As Long, _
ByVal nCmdShow As Long) _
As Long
Function DesktopIconsShow()
Dim hwnd As Long
hwnd = FindWindowEx(0&, 0&, "Progman", vbNullString)
ShowWindow hwnd, 5
End Function
Function DesktopIconsHide()
Dim hwnd As Long
hwnd = FindWindowEx(0&, 0&, "Progman", vbNullString)
ShowWindow hwnd, 0
End Function
You can also just hide the Icons on the deskTop
Code:Option Explicit 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 Private Declare Function ShowWindow _ Lib "user32" ( _ ByVal hwnd As Long, _ ByVal nCmdShow As Long) _ As Long Function DesktopIconsShow() Dim hwnd As Long hwnd = FindWindowEx(0&, 0&, "Progman", vbNullString) ShowWindow hwnd, 5 End Function Function DesktopIconsHide() Dim hwnd As Long hwnd = FindWindowEx(0&, 0&, "Progman", vbNullString) ShowWindow hwnd, 0 End Function
You can also just hide the Icons on the deskTop