I think this problem should be easy to solve, and I'm bringing it here because I really feel like I've looked everywhere for a solution.
My code is written in C# and should simply over write the Alt-Tab hotkey. This line works in XP but return false in 7:
RegisterHotKey(handle, ID__ALT_TAB, MOD_ALT, VK_TAB));
I know that Windows 7 now requires that I unregister the hotkey before I can register my new one, and this is where the problem lies. When I check on the last error code I get code 1409, meaning the hotkey already exists. However if I call this line before the one above:
UnregisterHotKey(handle, ID__ALT_TAB));
That line fails and the last error code is set to 1419, meaning no such hotkey exists. These lines do work in XP, and I am able to register a hotkey and then unregister it. I beleive it is because I am attempting to unregister a hotkey with the wrong ID, as ID_ALT_TAB is self defined. I havent been able to find the correct ID of the Windows level Alt-Tab HotKey. Any help or general pointers would be greatly appreciated.