c++ - MFC: How to catch set focus of each control of dialog in one function -
i have "n" dialogs have same base dialog. each dialog has own controls
- edit boxes
- combo boxes
- list controls
- etc.
in base dialog, how set focus messages of each control and,for example, give message box
text("hello got focus, id %d")?
according this article, can hook wm_setfocus message.
you can control id using getdlgctrlid hwnd
returned hook.
but beware of popping messagebox
, change focus , trigger hook proc, making go loop!
Comments
Post a Comment