Disabling Alt-Tab

Started by
26 comments, last by darkchrono4 20 years, 11 months ago
I know this has been asked a 1000 times already. But how do you disable alt-tab? I would tried to search for it but that seems to be down right now.
Advertisement
Dear God...

http://www.google.ca/search?q=disable+alt+tab&ie=UTF-8&oe=UTF-8&hl=en&meta=
http://www.experts-exchange.com/Programming/Programming_Platforms/Win_Prog/Q_10229593.html

try that link.. it looks like it''s pretty simple to disable.
Don''t. Apps that disable atl-tab are lame. Don''t penalize your users just because you are lazy.
-Mike
I know its lame, but I''m trying to protect some encypted files that much be decrypted while my app is running.

I got it to work in Win98 but it doesn''t in WinXP. Saw some code about using a keyboard hook but the procedure won''t compile for me. Is there something special that I have to do?

LRESULT CALLBACK LowLevelKeyboardProc (INT nCode, WPARAM wParam, LPARAM lParam)
{
KBDLLHOOKSTRUCT *pkbhs = (KBDLLHOOKSTRUCT *) lParam;
BOOL bControlKeyDown = 0;
switch (nCode)
{
case HC_ACTION:
{
bControlKeyDown = GetAsyncKeyState (VK_CONTROL) >> ((sizeof(SHORT) * 8) - 1); // Disable CTRL+ESC
if (pkbhs->vkCode == VK_ESCAPE && bControlKeyDown)
return 1;
// Disable ATL+TAB
if (pkbhs->vkCode == VK_TAB && pkbhs->flags & LLKHF_ALTDOWN)
return 1;
// Disable ALT+ESC
if (pkbhs->vkCode == VK_ESCAPE && pkbhs->flags & LLKHF_ALTDOWN)
return 1;
// Disable the WINDOWS key
if (pkbhs->vkCode == VK_LWIN || pkbhs->vkCode == VK_RWIN)
return 1;
break;
}
default:
break;
}
return CallNextHookEx (hHook, nCode, wParam, lParam);
}
Unless you can figure out how to disable networking too, what use is disabling alt-tab? Penalizing users with only one computer? Just surrender to the fact that any data placed on the client machine can be tampered with, and hence WILL be tampered with.
If you decrypt information on the client side, that means the client machine has the key somewhere, which means the user has the key. Even if you could find code to disable alt-tab on XP, it isn''t hard to make a program disable your disabler. Also, it isn''t hard to make a program monitor for new files and make a copy of any it finds. Even if you decrypted to RAM it wouldn''t be too difficult to get the decrypted data.

Allowing clients to decrypt the data means they also have the ability to see the unencrypted data. There isn''t much you can do about that.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
I'm not trying to protect the Kennedy files or anything. The keys for the files are in plain view. Just have to know what order they are used in and what to do with each. I'm just trying to keep the casual cheater from being able to see the decrypted mission files.

You don't have to get all NSA on me.

[edited by - darkchrono4 on May 7, 2003 5:37:51 PM]
Actuall for some reason
SystemParametersInfo(SPI_SETSCREENSAVERRUNNING,TRUE,&b,0);
works while the app is running but if I start the game alt-tab works but ctrl-alt-delete doesn''t. I think that keyboard hook might be the way to go if I could figure it out.
A casual cheater won''t be helped by being able to alt-tab out of your app. A determined cheater won''t be hindered by it. So what''s the point of doing it at all? You''re hurting your users and gaining nothing from it. Assuming you are able to find a comprehensive solution how much time did you waste doing it? How many users are you going to lose because when your app locked up they couldn''t alt-tab out to kill it?
-Mike

This topic is closed to new replies.

Advertisement