Results 1 to 3 of 3

Thread: Hiding all the Desktop Icons ??

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Posts
    87

    Post

    Is there a way to hide every icon on the desktop, without using "Show as Webpage" ?
    Or how do I disable the desktop, I know it's possible to disable the desktop....

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    To hide all Desktop Icons..
    Code:
    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
    
    Private Sub Command1_Click()
        Static bDisable As Boolean
        Dim lHwnd As Long
        bDisable = Not bDisable
        lHwnd = FindWindowEx(0, 0, "Progman", vbNullString)
        ShowWindow lHwnd, IIf(bDisable, SW_HIDE, SW_SHOW)
    End Sub
    To Disable all Desktop Icons..
    Code:
    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
    
    Private Sub Command1_Click()
        Static bDisable As Boolean
        Dim lHwnd As Long
        bDisable = Not bDisable
        lHwnd = FindWindowEx(0, 0, "Progman", vbNullString)
        lHwnd = FindWindowEx(lHwnd, 0, "SHELLDLL_DefView", vbNullString)
        lHwnd = FindWindowEx(lHwnd, 0, "SysListView32", vbNullString)
        ShowWindow lHwnd, IIf(bDisable, SW_HIDE, SW_SHOW)
    End Sub

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]

  3. #3
    Hyperactive Member
    Join Date
    Jul 1999
    Location
    NY, USA
    Posts
    270

    Post

    You could also see this page: http://www.vb-world.net/registry/registry3/index5.html

    It tells you how to do so using the registry.

    ------------------
    Tom Young, 14 Year Old
    [email protected]
    ICQ: 15743470
    AIM: TomY10
    PERL, JavaScript and VB Programmer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width