and put some capturing code in WM_COMMAND. by the way, there are no child windows in this program, so i dont need to subclass or anything to get the accelerator message.

something is not right, because spy++ shows that no message is being sent for the accelerator, just the usual bunch of keydown and keyup messages. how do i fix it?

12-15-2002

bennyandthejets

i narrowed down the problem a bit more. if you specify the flags FSHIFT or FCONTROL, the accelerator will ONLY work if you press the designated key by itself. however the FALT flag works fine. when flags are combined, eg, FALT|FCONTROL, the accelerator works only when ALT and the key are held down. if CTRL is held down, it doesn't work. the same goes for SHIFT.
it seems to me that the status of the CTRL and SHIFT keys is reversed as far as my program is concerned. anyone ever had this happen to them?

12-15-2002

Ken Fitlike

When you do this:

Code:

if(!TranslateAccelerator(Msg.hwnd, accTable, &Msg))

The msg is sent to whatever window procedure is defined for 'Msg.hwnd'. If you want all your accelerator keys to be picked up by your parent window then use its handle exclusively instead.