Disabling Windows Key and Alt-Tab

This is a discussion on Disabling Windows Key and Alt-Tab within the Windows Programming forums, part of the Platform Specific Boards category; Hello, I'm really frustrated with trying to get windows to behave itself... Here's what I want to do: If my ...

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    4

    Question Disabling Windows Key and Alt-Tab

    Hello,

    I'm really frustrated with trying to get windows to behave itself...

    Here's what I want to do:

    If my program is running, and the user hits the windows key, I want to prevent the start menu from popping up. I'm also interested in stopping alt-tab from working too.

    Here's what I've tried:

    - Capturing the WM_KEYUP, WM_KEYDOWN, WM_SYSKEYUP, and WM_SYSKEYDOWN messages. I can register that the key has been, in fact, pressed, but nothing I do seems to stop the start menu from popping up anyway.

    - Getting exclusive access to they keyboard with DirectInput. Windows simply won't let me do that, and even if I could, I doubt it would work.

    - Creating my window with WS_EX_TOPMOST, etc. System modal has been deprecated, so I don't want to try using that.

    Any help would be very much appreciated!

    Thanks,
    Owlet

  2. #2
    Registered User (TNT)'s Avatar
    Join Date
    Aug 2001
    Location
    UK
    Posts
    339
    Hey Owlet,

    I think you approching the problem wrongly, in that there are functions that you can use for this problem. Now i cant check this code casue im on XP and stopping alt+tab and start menu on xp is alot harder than it was before. But this code stops control alt and del and i think alt+tab and winkey as well, atleast when i made a security prog a few years back i used somthing like this code and it worked but try this it should work:

    SystemParametersInfo(SPI_SCREENSAVERRUNNING, 1, 0, 0); //Turn Off Crtl+alt+del

    SystemParametersInfo(SPI_SCREENSAVERRUNNING, 0, 0, 0); //Turn On Crtl+alt+del


    That may not be the one for alt tab, but i do know that the function for turning off alt and tab will also turn off the winkey. Try that though.

    Thanks
    TNT
    TNT
    You Can Stop Me, But You Cant Stop Us All

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    4
    That works great! Thanks for your help, TNT.

    Owlet

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 10:00 AM
  2. Disable ALT key commands
    By Lionmane in forum Windows Programming
    Replies: 9
    Last Post: 09-23-2005, 11:41 AM
  3. Directional Keys - Useing in Console
    By RoD in forum C++ Programming
    Replies: 38
    Last Post: 10-06-2002, 05:42 PM
  4. FAQ: Directional Keys - Useing in Console
    By RoD in forum FAQ Board
    Replies: 38
    Last Post: 10-06-2002, 05:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21