CodeItBetter Programming Another VB Programming Blog

How to Show/Hide all Desktop Icons

Posted on January 4, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'System & API - How to Show/Hide all Desktop Icons
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
Private Const SW_HIDE = 0
Private Const SW_SHOW = 5
 
Sub Main()
    Call HideDesktopIcons(True)    'To Hide Desktop Icons
    'Call HideDesktopIcons(False) 'To Show Desktop Icons
End Sub
 
Public Sub HideDesktopIcons(ByVal blnHide As Boolean)
    Dim lHwnd As Long
    lHwnd = FindWindowEx(0, 0, "Progman", vbNullString)
    ShowWindow lHwnd, IIf(blnHide, SW_HIDE, SW_SHOW)
End Sub

Related posts:

  1. How to Show/Hide the Start Button from the task bar
  2. How to Show/Hide your SystemTray
  3. How to Set the ShowInTaskBar Property at Runtime
  4. How to Change the visibility of the app in the taskbar at runtime
  5. How to Hide/Show the Title bar at Run-Time
  6. How to Hide your Program from the Ctrl-Alt-Del Process list
  7. How to Get The Desktop Path
  8. How to Show/Hide ComboBox’s DropDown List
  9. How to show/hide the cursor/caret in a text box
  10. How to open a folder in explorer in particular folder view

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.