Link to home
Start Free TrialLog in
Avatar of Rob Siddell
Rob SiddellFlag for United States of America

asked on

How do i block certain keys in Windows?

I am looking for code examples in order to prevent the start menu from popping up when one presses the window's key or any other key combination that i don't want going thru to windows.

Rob
Avatar of albay
albay

hi sorlus. try this.
it disables Alt+TAB and Ctrl+ESC keys.

var OldVal : Longint;
begin
   SystemParametersInfo(97, Word(True), @OldVal, 0); //disable;

change Word(True) -> Word(False) to enable keys...
end;

hope this helps
best wishes
albay
Hi sorlus,

you can register system wide hotkey with virtual code the same as key you want to lock, and then do nonthig on WM_HOTKEY message.

-----
Igor
albay,

what's 97, the screen saver message ?

rondi.
Install a message-filter hook.
Avatar of Rob Siddell

ASKER

Igor or Tasomia if you could please elaborate a little more as i would like coded examples and such

Thank you

Rob
ASKER CERTIFIED SOLUTION
Avatar of Igor UL7AAjr
Igor UL7AAjr
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok Igor so far the points are in you pocket but i would like to know how to apply that to other key combos like if they press the window's key or any other key i choose i would like to know how to apply it to that.

Rob
ok after looking at the code a bit that will do the points are yours :)

Rob
Thank you

Rob
thank you too :-)