CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2006
    Location
    Mnila, Philippines
    Posts
    171

    disable the desktop

    I tried searching different site asking how to disable the desktop but unluckily they ask me why I would like to do this and not giving hint or idea at all. I hope someone will help me. I'd successfully disable the task manager and my problem for now is how to disable the desktop. When my application starts, the desktop will lock and only my program are allowed to be used. This will avoid the user in opening some application like word, internet, games etc and click some icons in the desktop. This is our clients request so I have to do this.

    Any suggestions guys! thanks

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: disable the desktop

    Why not simply just disable the Start button - which gives access to all those you've mentioned?

    I'll also jump on the bandwagon and ask why this is needed?

  3. #3
    Join Date
    Jul 2006
    Location
    Mnila, Philippines
    Posts
    171

    Re: disable the desktop

    How about the icons and folders in desktop? And how about the applications that were open before opening the application. It should be disabled and not to be terminated.

  4. #4
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: disable the desktop

    You cannot lock the desktop like that par se. An API called SystemParametersInfo comes to mind - this will enable you to block keys such as ALt + Tab ( so that a person cannot swicth to an open application ). Also, you can hide the taskbar buttons ( the open windows ), by using FindWindow and FindWindowEx to find the ReBarWindow32 window; then using the ShowWindow API. As for your icons on your desktop, have a look here :

    http://social.msdn.microsoft.com/For...7-f514d442435f

    I have mentioned quite a few methods to achieve this, the onus is on you just to google a bit

    Hannes

  5. #5
    Join Date
    Jun 2010
    Posts
    85

    Re: disable the desktop

    I would just kill explorer.exe and then lock of Alt+Tab as HanesTheGreat suggests.
    --------------------------------------------------------------------------------------------------------------------------
    Disclaimer - Most likely any code I have posted as an answer was most likely written free hand and may have some minor compile errors, and is merely intended to give you the idea.

  6. #6
    Join Date
    Jul 2006
    Location
    Mnila, Philippines
    Posts
    171

    Re: disable the desktop

    Thanks guys. But i find in the net the winLock.dll. Maybe this would the answer to my question.

  7. #7
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: disable the desktop

    The answer to your question is to go back to the customer and tell them it is a bad idea.

    No user is going to think that a game is great enough to want to lose control over the desktop.

    Also, what happens if the game froze (after disabling the desktop)? How is a user going to get their computer back?

    Some requirements are horrible. An experienced developer needs to be able to know when.

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

Featured