I've made a WPF application and I was able to hook some of the windows combinations. ALT+TAB is hooked and it is doing nothing when my application is running (as expected). The problem is when I press the CTRL+ALT+TAB I get the same effect as ALT+TAB. Do you guys have any idea on how to hook this kind of combination?
EDIT:
I have already successfully hooked ALT+TAB. I do want to hook CTRL+ALT+TAB. I've tried this project example to make this happen.
Here's the code that makes the hook:
private static IntPtr KeyboardHookHandler(int nCode, IntPtr wParam,
ref KBHookStruct lParam){
if (nCode == 0)
{
if (((lParam.vkCode == 0x09) && (lParam.flags == 0x20)) || // Alt+Tab
((lParam.vkCode == 0x1B) && (lParam.flags == 0x20)) || // Alt+Esc
((lParam.vkCode == 0x1B) && (lParam.flags == 0x00)) || // Ctrl+Esc
((lParam.vkCode == 0x5B) && (lParam.flags == 0x01)) || // Left Windows Key
((lParam.vkCode == 0x5C) && (lParam.flags == 0x01)) || // Right Windows Key
((lParam.vkCode == 0x73) && (lParam.flags == 0x20)) || // Alt+F4
((lParam.vkCode == 0x20) && (lParam.flags == 0x20))) // Alt+Space
{
return new IntPtr(1);
}
}
return CallNextHookEx(hookPtr, nCode, wParam, ref lParam);}