Disable Windows Key
BlitzMax Forums/BlitzMax Programming/Disable Windows Key
| ||
Does any one have any code to disable the windows key. To Prevent minimize. |
| ||
Why not...If AppSuspended() 'wait til Not AppSuspended() EndIf |
| ||
You could use windows hooks, heres an example using a low-level keyboard hook that disables the left WIN key and the right WIN key as long as the hook is active. see Windows Hooks for more info. hook.c Compile dll: gcc -shared hook.c -o hook.dll Hook.bmx test.bmx SuperStrict Import "Hook.bmx" If LoadHook( "hook.dll") Then Print "Hook is loaded." If InitHook( WH_KEYBOARD_LL, "keyboard_hook") Then Notify "Hook is active, waiting for termination" Else Print "error:InitHook() failed" EndIf Else Print "error:LoadHook() failed" EndIf FreeHook() |
| ||
I don't know what any of that does. Will the user still be able to right-click on the task bar and select 'show desktop'? Because that minimises everything thats open. Its far better to get your program to recognise and operate safely in a minimised state, than trying to stop the user minimising it in the first place. |
| ||
You should do both, its not very fun to drop out of the game just because you hit the wrong key. Other things that could be disabled are the Accessibility keys. (they are allso annoying ;) EDIT: yeah the ShowDesktop menu will probably still work. |
| ||
What GfK says. People who mess up Windows deserve to watch Tomb Raider in hell for all eternity. Other things that could be disabled are the Accessibility keys. You're supposed to disable those yourself, if you don't need them. |
| ||
Thanx for all the replies/code guys, I will try these. I don't want to completely do away with minimizing. It's just an option for certain things! I can get my apps to minimize and maximize alright - The only problem i seem to have is while minimized the music still plays! So i need to trap the input and pause/disable the sound channel during that time. |
| ||
The only problem i seem to have is while minimized the music still plays! So i need to trap the input and pause/disable the sound channel during that time. AppSuspended() is what you need. |
| ||
Thanx Gfk... I will try this... |
| ||
Well thats worked well so far, I am now patching and updating my latest 3 Bmax game releases! I may post them in the Showcase later for testing and feedback :) Thanx again everyone! |