Control+Shift via GetAsyncKeyState() on Vista?
I have an installer that needs to detect whether both the Control and Shift keys are being pressed as it launches so as to enable certain advanced features. I use GetAsynchKeyState() under XP to do this, and it works fine.
However, I've just tried doing this under Vista and discovered that it doesn't work. GetAsynchKeyState() returns the expected result if one or the other key is held down, but if both are down, it returns 0 in both cases.
I tried substituting both GetKeyState() and GetKeyboardState() instead, but the result is the same.
Anyone seen this before?
The code is pretty straightforward:
System::Call "user32::GetAsyncKeyState(i 0x11) i .r0 ? !e"
IntOp $0 $0 & 0x8000
${If} 0 <> $0
System::Call "user32::GetAsyncKeyState(i 0x10) i .r0 ? !e"
IntOp $0 $0 & 0x8000
${If} 0 <> $0
IntOp $0 1 +
${EndIf}
${EndIf}