PDA

View Full Version : Qt/MFC Event Loop - stop MFC receiving event?



Kaylx
24th April 2012, 09:54
Hey peeps,

I'm currently using the Qt/MFC Migration Framework to get an existing MFC application to work with my new Qt (top-level modeless) window (running on a separate thread).

It generally works ok except for, a window focusing bug, and the one i'm here to ask about which is Context Sensitive (F1) Help.

Basically when the user hits F1 I want Qt to handle the event and bring up an online help file. I can get this working without issue, however MFC also receives the F1 (ID_HELP) event and wants to open help (using WinHelp) as well. I don't want MFC to receive that event, i only want Qt to handle it. I've tried installing an eventFilter and returning true as well as calling event->ignore()/event->accept() to no avail.

Does anyone have any ideas how i can stop MFC receiving the F1 help message?

Regards,
Kaylx

d_stranz
26th April 2012, 19:57
How about installing a handler on the MFC side to silently eat the message?