Thread: Disable Windows keys

  1. #1
    Registered User
    Join Date
    Aug 2003

    Disable Windows keys

    I was wondering if anyone knew how to disable Alt-F4, Ctrl-Alt-Delete, and Alt-Tab.

    Im trying to make a screen locking program, where u have to input the right password, or u wont be granted access, but i dont want any random user to just press alt-f4 and exit the prog.



  2. #2
    prevent [ALT]+[F4] using this:

    	if( SC_CLOSE == wParam ) return 0;
    [ALT]+[TAB], [CTRL]+[ALT]+[DEL] and [WIN] at once can be disabled using this:

    SystemParametersInfo( SPI_SCREENSAVERRUNNING, TRUE, NULL, 0 );
    i hope that helps. drop me a mail when your done and i'll test it....

    greetz // bass aka hartwork

  3. #3
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    I wrote a program that does the exact same thing. Just make sure you don't make the same mistake I did (see my post on the Tech board asking for a way around my own program). Make sure you write some way around the program in case you forget the password.

    I wrote the program a year and a half ago for someone else and I just happened to see it on my computer and ran it and I forgot the password, so I rebooted, but I made it add itself to the registry and always restart! The only way I fixed it was by finding a copy of the program on my work PC, so I looked at the constants section of the exe for the hardcoded password.

  4. #4
    Registered User
    Join Date
    Aug 2003
    Thanx for the reply hartwork, the Alt-F4 code works perfectly, but the Screensaver code didnt work, i dont think it works for Windows XP/NT.

    Lucky, is it possible for you to show me the code you used to make the systemwide hook? Ive tried everything and so far i cant disable the windows keys except for Alt-F4

    Thanx again


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How MS Windows keys work
    By ober in forum Tech Board
    Replies: 1
    Last Post: 01-07-2005, 01:02 PM
  2. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  3. Disable Messenger Service Windows
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 08-22-2003, 05:07 PM
  4. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM