Skip to main content
GameDev.net gamedev.net
🔒 Locked

Disabling Alt-Tab

Started by darkchrono4 May 7, 2003 at 2:07 PM 26 replies 1.8k views
Original Post
darkchrono4
darkchrono4
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.
ISOPimp
ISOPimp
Dear God...

http://www.google.ca/search?q=disable+alt+tab&ie=UTF-8&oe=UTF-8&hl=en&meta=
Ronin Magus
Ronin Magus
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.
Anon Mike
Anon Mike
Don''t. Apps that disable atl-tab are lame. Don''t penalize your users just because you are lazy.
-Mike
darkchrono4
darkchrono4
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);
}
Teodric
Teodric
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.
Extrarius
Extrarius
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
darkchrono4
darkchrono4
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]
darkchrono4
darkchrono4
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.
Anon Mike
Anon Mike
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
darkchrono4
darkchrono4
I was only asking for a bit of help. Not everybody''s ethical opinion on the matter.
original vesoljc
original vesoljc
why not keep the decrypted info in memory?
Abnormal behavior of abnormal brain makes me normal...
Illumini
Illumini
*Agrees with vesoljc...

I can''t think of any file reading/writing decryption algorythm that couldn''t simply be ported to writing into memory instead of to disk after decrypting.

A much better solution since it would also prevent network cheaters/new file seekers/ etc..

Of course a determined cheater could still get it, but you already said your just trying to stop casual cheaters
darkchrono4
darkchrono4
Because the info isn''t mine. My program is a wrapper for another. I would just decrypt missions as I needed them. But I have no way of telling when a new mission is needed. So to prevent people from alt-tabbing out of the game to edit the missions I wanted to disable that. I know its cheap but usually when these games crash it takes Windows with it. So its not to much of a problem having my program lock up.
darkchrono4
darkchrono4
Its quite apparent that nobody knows how to do it. A little more helping and a little less bashing of topics would be nice around here. Quite a few topics that you people just bash the posters instead of trying to help them. Sorry to say but if they wanted your opinion they would ask for it. If you don''t know anything fine, just don''t spout off so that you look cool.
patindahat
patindahat
Ok, I got a situation here were disabling ALT+TAB and ALT+F4 and ALT+CTRL+DEL is my only option, but many people seem to be against it so please tell me if you have a suggestion.

I''m making an application for a local business so that the customer can order some products when it is busy and they don''t want to wait in line. So it MUST be very user friendly and familiar to as many people as possible. So obbiously this means a typical MFC style windows program. I have further narrowed it down to a step by step ''wizard'' style application. But I don''t want the user to exit the program or have access to anything else on the computer. So how do I get this without disabling ALT+TAB, ALT+F4, and ALT+CTRL+DEL?

Pat
Nypyren
Nypyren
Just have some code reboot the computer when the window gets a LostFocus event.
gmcbay
gmcbay
There''s no 100% guaranteed way to stop "ALT-TAB" situations. Go ahead and disable alt-tab...the user can still pull up an explorer Window in 100s of different ways.

Any program that tries to disable alt-tab or do any stupid shit like that gets removed from my computer immediately. If they are so unprofessional as to try and do such a thing, I have no trust in their software. I''ll also tell everyone I know to stay away from it. It is just a stupid thing to do, period.

darkchrono4
darkchrono4
Its cool to download warez and be l33t. So I don't want to hear some holier then thou crap when you don't know an answer.

Though I was thinking would it be possible to trap a keystroke and keep the system from doing anything with it? Would it be possible to say when tab is pressed take that keystroke from the buffer?

[edited by - darkchrono4 on May 12, 2003 2:22:30 AM]
Extrarius
Extrarius
I don't know about XP and 2000, but in NT you could edit the profile and set options to only allow the running of certain applications. If you restrict viewing of all drives, disable the task manager, and set your programs as the only valid program to run, it should acomplish the effect you want. You would probably also want to go to the trouble of removing everything from the start menu and removing every icon you can from the desktop just to make it look nice, but as long as there is an obvious way to access the program from the desktop(make a shortcut as admin and remove delete and write permission from everybody, then make it autologon on a less priveleged user so they can use the shortcut but not change or remove it) and no other programs can be run, it shouldn't be a problem.

[edited by - Extrarius on May 12, 2003 3:22:12 AM]
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.