Archived

This topic is now archived and is closed to further replies.

Disabling Alt-Tab

This topic is 5327 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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);
}

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
*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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
There''s really not much point in even punishing casual cheaters. If they feel like they want to cheat their way through the game, why not let them? Lots of games have even gone so far as to simply provide in game cheat codes, and that way the cheaters don''t have any need to go poking around with the program files. Even cheaters are playing your game, so why punish them.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I think most people here want to talk about programming, not hackery like disabling functionality like alt-tab that are not supposed to be disabled. And since it is not supposed to be disabled, there is no reason why microsoft should provide a consistent means to do it from platform to platform. Even if someone did know how to disable it on all current operating systems, there is no guarantee that those methods would work on the next version of windows, or that there would be any method that would work.

On the other hand, lots of reasons have been provided why alt-tabbing should not be disabled anyway. Any methods of disabling alt-tab are just hacks that generally shouldn''t be done. And this is the reason that it is so hard to find a way to get it to work across all windows platforms.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
quote:
Original post by patindahat
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.


Sounds like what you''re doing is designing a kiosk application? That''s "making the system run only one application", not "disabling Alt-Tab", and I bet you''ll find instructions on MSDN. As mentioned, the way to do that is locking out stuff in profiles (registry work), not doing things to your own application. Well, not much at least.

Share this post


Link to post
Share on other sites
The main thing is, little hacks like this shouldn''t be an attempt to cover gigantic security flaws. It''s a horrible idea, it''s like thinking that you can protect your HTML scripting with right-click disabling.

If something is on a computer, there is always a way to get to the data. Fooling your customers into beliving that a totally insecure program is secure is a good way to get yourself sued. Fast.

Share this post


Link to post
Share on other sites