Link to home
Start Free TrialLog in
Avatar of jdunck
jdunck

asked on

Remove System Shortcuts from Desktop

Hola,
  I want to know how to remove standard system desktop icons (such as My Computer and Recycle Bin).  
  Basically, I am running an app on a handheld computer, and I want only my app to run.  
  I have already got it running as startup, locked down the start button, and disabled "WinKeys" such as Alt-Tab, Ctrl-Alt-Del, and the like.  I am also shutting down Windows when the app closes.  
  The problem is that the user can still open My Computer before my app can load (it is a handheld.. it is slow), and use that to get around in Windows.  I want to remove everything from the Desktop.
 
  TIA,
     JDunck
ASKER CERTIFIED SOLUTION
Avatar of KDivad
KDivad

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KDivad
KDivad

I suppose that doesn't exactly answer your question, but it should work a little better since explorer takes a while to load and uses a TON of resources.
Why don't you try to disable the desktop ?
I think codes below can answer your question

Declare Function EnableWindow Lib "user32" (ByVal hWnd As Long, ByVal cmd As Long) As Long
Declare Function FindWindow& Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String)
Declare Function FindWindowEx& Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String)

' to disable windows desktop
Dim lParent As Long
lParent = FindWindow("Progman", vbNullString)
Dim lChild1 As Long
lChild1 = FindWindowEx(lParent, 0, "SHELLDLL_DefView", vbNullString)
Dim lChild2 As Long
lChild2 = FindWindowEx(lChild1, 0, "SysListView32", vbNullString)
Call EnableWindow(lChild2, 0)

'to enable windows desktop
Dim lParent As Long
lParent = FindWindow("Progman", vbNullString)
Dim lChild1 As Long
lChild1 = FindWindowEx(lParent, 0, "SHELLDLL_DefView", vbNullString)
Dim lChild2 As Long
lChild2 = FindWindowEx(lChild1, 0, "SysListView32", vbNullString)
Call EnableWindow(lChild2, 5)



Instead of using lengthy code to disable the desktop (if you don't wish to replace the shell) and since it appears you wish to have this method all the time merely edit one value in the registry to disable the desktop:

Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
Value Name: NoDesktop
Data Type: REG_DWORD
Data: (0 = disabled, 1 = enabled)

Avatar of jdunck

ASKER

KDivad,
  I still want it to "feel" like Win95.. I just don't want the users to get outside my app.
  Your second suggestion does it for me.  Thanks a bunch :)

  -JDunck
Glad one of my suggestions helped. Your Welcome.