c++ - Pass through accelerator key while modeless dialog window up -
we have large in-house mfc app. has main window menubar, , hundreds of unique subwindows (without menubars) display on top of main window (not simultaneously). these subwindows implemented cdialog
s run modelessly (via createwindow
, not domodal
). parent hwnd
set null
.
we got feature request--allow particular menubar accelerator main window work, when 1 of subwindows active window. make sense user perspective.
this faked pretty application-wide keyboard hook, watching exact keystroke, wondering if there cleaner way?
you can use registerhotkey()
in main window. have side effect new hotkey trigger if pressed in different application. can work around comparing getcurrentprocessid()
getwindowthreadprocessid(getforegroundwindow())
Comments
Post a Comment