-
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.
Thanx
PaYnE
-
prevent [ALT]+[F4] using this:
Code:
case WM_SYSCOMMAND:
{
if( SC_CLOSE == wParam ) return 0;
break;
}
[ALT]+[TAB], [CTRL]+[ALT]+[DEL] and [WIN] at once can be disabled using this:
Code:
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
-
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.
-
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
PaYnE