I have a simple dialogbox based program. I made a few push buttons and used & to underline my desired hotkey mnemonic, which automatically assigns a shortcut to that letter. So when a user presses that letter the button is 'clicked'.

However, I'm using GetAsyncKeyState with a polling timer to detect keystrokes so I can capture the shortcuts even when my program doesn't have focus (which is a must). This works well but when the dialog has focus both methods get invoked so the button gets clicked twice.

Is there any way to intercept the automatic mnemonic based shortcut so I can ignore it? I could simply enclose my shortcut letter in brackets or something instead of having it underlined with & but I would like to conform to the standard notation if possible.
Posted on 2004-07-31 06:20:06 by