Hi,
is there a way to disable the "system behaviour" of the 'left alt' key in a window?
Please note that I don't wanna completely disable it, I only need to disable the "special" system behaviour.
Hi,
is there a way to disable the "system behaviour" of the 'left alt' key in a window?
Please note that I don't wanna completely disable it, I only need to disable the "special" system behaviour.
Are you handling WM_SYSKEYDOWN messages?
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646286%28v=vs.85%29.aspx
Are you handling WM_SYSKEYDOWN messages?
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646286%28v=vs.85%29.aspx
thank you, it worked. Now I have to disable the alt-space combo for the app-menu but a simple style-change should works.
Are you handling WM_SYSKEYDOWN messages?
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646286%28v=vs.85%29.aspx
thank you, it worked. Now I have to disable the alt-space combo for the app-menu but a simple style-change should works.
Ok, this works for a single click/action of the left-alt key:
case WM_SYSKEYDOWN:
if( wParam == VK_MENU )// left-alt key
{
foo();
}
break;
but if the left-alt key is not released, the key still behave as a system command...
You should get another WM_SYSKYDOWN message with bit 29 set to 1 in the lParam in that case?
Bits Meaning 29 The context code. The value is 1 if the ALT key is down while the key is pressed; it is 0 if the WM_SYSKEYDOWN message is posted to the active window because no window has the keyboard focus.
You should get another WM_SYSKYDOWN message with bit 29 set to 1 in the lParam in that case?
Bits Meaning 29 The context code. The value is 1 if the ALT key is down while the key is pressed; it is 0 if the WM_SYSKEYDOWN message is posted to the active window because no window has the keyboard focus.
default:
lParam |= 1 << 29;
return( DefWindowProc( window, message, wParam, lParam ) );
in this way I can disable the application system menu, but the left-alt key still behaves as a "system key" (ie: if left-alt key is still pressed, message case like WM_KEYDOWN are not processed and the windows "ding" sounds .-. )
What I want is disable this "special system behaviour" to the left alt key, but maybe that's not a good idea... :s
I don't get why you are modifying lParam?
If you don't want the default behaviour, return the appropriate value from your window procedure to say you handled it, and DO NOT call DefWindowProc if you handle the message yourself.
sorry, it's late here ( 03:43 AM.).. maybe I should go to sleep...
so this is what I have:
case WM_SYSKEYDOWN:
if( wParam == VK_MENU || wParam == VK_F10 )// left-alt and f10 keys
{
foo();
}
break;
this works fine with F10: the application process other case-action (like WM_KEYs messages) even if the F10 key is not released. That's not happens if the left ALT key is not released: I got the annoying windows "ding" sound and other things associated to other message cases don't happen.
Thank you for your patience
never mind, I will redefine the alt-key with a custom LowLevelKeyboardProc, Windows could be such a bitch...