c++ - Mouse message handling in win32 -
when user clicks on window b window c becomes visible.
situation 1 : while window c visible , user clicks anywhere on window or b or other child windows of window a, window c becomes invisible.
situation 2 : while window c visible , user clicks on window c program few things , makes window c invisible. [window c has more child windows]
how achieve functionality ?
the setcapture won't work situation 2.
in window b got, works situation 1, not situation 2.
lresult windowb::lbuttondown ( hwnd hwnd, uint message, wparam wparam, lparam lparam ) { if ( !capture ) { ::setcapture ( hwnd ); capture = true; windowc->show ( ); } else { ::releasecapture ( ); capture = false; windowc->hide ( ); } return 0; };
p.s : using pure winapi oop c++, , own wrapper windows , message handling.
edit: more code added requested.
lresult windowc::lbutton ( uint message, wparam wparam, lparam lparam ) { dostuff ( ); ::postmessage ( hparent, wm_command, wparam ( bn_clicked ), lparam ( hwnd ) ); return 0; };
Comments
Post a Comment