Skip to main content
gamedev.net
🔒 Locked

Windows ALT-TAB

Started by Mythar 8 replies 750+ views
Original Post
Mythar
Mythar
Hi all, dose anyone know how to desable Windows ALT-TAB.
mordell
mordell


The solution regarding the screen saver doesn''t work as mentioned:

//: from help file ..
UINT nPreviousState;

// Disables task switching
SystemParametersInfo (SPI_SETSCREENSAVERRUNNING, TRUE, &nPreviousState, 0);

// Enables task switching
SystemParametersInfo (SPI_SETSCREENSAVERRUNNING, FALSE, &nPreviousState, 0);

..at least on my NT 4.0 machine.

However, there is an alternative solution that seems to work just fine:

//: sometime during window creation
RegisterHotKey(hwnd, 0x01, MOD_ALT, VK_TAB);

//: before app exits
UnregisterHotKey(hwnd, 0x01);

-mordell


__________________________________________

Yeah, sure... we are laughing WITH you ...
ziplux
ziplux
Isn''t there a flag used on DirectDraw creation that says something about ALT-TAB? I''ll check my code in about an hour.
drago
drago
Go to the MSDN:

http://support.microsoft.com/view/dev.asp?kb=243455

----------
Drago
osu!
PRISMA
PRISMA
Well, I am sure there are ways to disable ALT-TABBING, but to tell you the truth, do you really want to? The whole purpose of windows is to allow multiple programs to run simultaneously. What if users need to ALT-TAB out of your app every so often (I know I have done it in the past). One other thing, is that if you ever plan to release a commercial app, wether it be a game or not, you must adhere to certain standards (set by MS and others), or else your app will be marked as incimpatable. You know that ''Designed for Windows x.x'' logo. You won''t get that unless you follow the standards.
Melo
Melo
Yes, it is better, if you don''t disable it, but there is a way of doing it... remove the WinMSG-stuff from your code (PeekMessage/TranslateMessage/DispatchMessage/...) and return 0 instead of msg.wParam. But Ctrl-Alt-Del will B disabled, too
Mythar
Mythar
Thanx, for you replies
Loqi
Loqi
Hey PRISMA, try telling that to Team17 (mumbles incoherently about Worms: Armageddon).

Topic Locked

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

Sign in to reply to this topic.