Results 1 to 2 of 2

Thread: Hiding Icons on Windows Desktop

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Location
    Manchester
    Posts
    1

    Question

    I have need to shell an application that removes all the icons from the desktop. When the application ends it restores them. I need to be able to shell the app and then restore the icons - because I don't want them removed.

    Anyone have any ideas how this is achieved?

  2. #2
    Guest
    Code:
    Declare Function findwindow Lib "user32" _
     Alias "FindWindowA" (ByVal lpClassName As String, ByVal _
    lpWindowName As String) As Long
    
    Public 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
    
    Declare Function showWindow Lib "user32" Alias "ShowWindow" _
    (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    
    Public Const SW_HIDE = 0
    Public Const SW_SHOW = 5
    
    Dim progman&
    Dim shelldlldefview&
    Dim syslistview&
    Dim tray&
    
    
    Private Sub Command1_Click()
    'Hide
    progman& = findwindow("progman", vbNullString)
    shelldlldefview& = FindWindowEx(progman&, 0&, "shelldll_defview", vbNullString)
    syslistview& = FindWindowEx(shelldlldefview&, 0&, "syslistview32", vbNullString)
    tray& = findwindow("Shell_TrayWnd", vbNullString)
    Y = showwindow(syslistview&, SW_HIDE)
    X = showwindow(tray&, SW_HIDE)
    End Sub
    
    
    Private Sub Command2_Click()
    'Show
    progman& = findwindow("progman", vbNullString)
    shelldlldefview& = FindWindowEx(progman&, 0&, "shelldll_defview", vbNullString)
    syslistview& = FindWindowEx(shelldlldefview&, 0&, "syslistview32", vbNullString)
    tray& = findwindow("Shell_TrayWnd", vbNullString)
    Y = showwindow(syslistview&, SW_SHOW)
    X = showwindow(tray&, SW_SHOW)
    End Sub

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