c++ - ON_NOTIFY not working in my dialog when I have ON_NOTIFY_REFLECT defined by the control -


in ctreectrl derived class, acting on tvn_itemexpanded:

on_notify_reflect(tvn_itemexpanded, &ontvnitemexpanded) 

in control's parent dialog, want act upon same notification, tvn_itemexpanded,

on_notify(tvn_itemexpanded, idc_element_tree, &ontvnitemexpanded) 

however, control class's ontvnitemexpanded method getting called, never dialog's. using both breakpoints , seeing desired behavior (or lack of desired behavior) in both methods verify control class's method being called, not dialog's method.

but, if comment out on_notify_reflect ctreectrl-derived begin_message_map, dialog's method gets called!?!

why can't notification go both control , dialog?!?

on_notify_reflect overrides on_notify, can use on_notify_reflect_ex instead lets callback decide if message should go through parent or not.

see message reflection windows controls more detailed explanation:

if, in parent window class, supply handler specific wm_notify message or range of wm_notify messages, handler called if child control sending messages not have reflected message handler through on_notify_reflect(). if use on_notify_reflect_ex() in message map, message handler may or may not allow parent window handle message. if handler returns false, message handled parent well, while call returns true not allow parent handle it. note reflected message handled before notification message.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -