Click to See Complete Forum and Search --> : Windows Special Keys


Sugan
May 7th, 1999, 04:20 PM
Is there any way to disable Windows Left & Right keys from within a process?

May 9th, 1999, 01:56 PM
How do you mean disable? For the whole machine or only for your process?? If for your process, use PreTranslateMessage in CWinApp and take care of WM_KEYDOWN + WM_KEYUP for VK_LEFT and VK_RIGHT.

/Rob

Sugan
May 11th, 1999, 03:27 PM
When I am running my application, I don't want Windows Special Left/Right keys to function. i.e. if the user presses Left/Right Windows key, Windows 95/NT should not display Start menu.
(note: not all the keyboards have these keys )

Also, my application is not done using MFC. I would appreciate any feed back.

Sugan

May 11th, 1999, 04:39 PM
The virtual keycode for these keys are VK_LWIN and VK_RWIN (def'd in winuser.h). I'm not sure, but you could try setting a hook on the keyboard input when using your application with SetWindowsHookEx (trapping the codes above) then UnhookWindowsHookEx when you're finished.

/Rob