c++ - How to handle event of push button on non client area -


edit: i’ve used following code draw push button @ non client area (the title bar) of window. question is: possible handle mouse click event button?

bool mainwindow::winevent(msg *pmessage, long *result) {     uint m = pmessage->message;     if(m == wm_ncpaint || m == wm_activate)     {         hwnd id = winid();         hdc hdevicecontext = getwindowdc(id);         rect rc = {10, 10, 65, 25};         drawframecontrol(hdevicecontext, &rc, dfc_button, dfcs_buttonpush);         releasedc(id, hdevicecontext);         return true;     }     return qwidget::winevent(pmessage, result); } 

yes quite easy do. windows provides several messages non-client area. example have wm_ncmousemove can handled wm_mousemove non-client area. of messages work client-area counterparts , same data structures. below list of non-client area messages.

wm_nccreate wm_ncdestroy  wm_nccalcsize wm_nchittest  wm_ncpaint  wm_ncactivate  wm_ncmousemove wm_nclbuttondown wm_nclbuttonup wm_nclbuttondblclk wm_ncrbuttondown wm_ncrbuttonup wm_ncrbuttondblclk wm_ncmbuttondown wm_ncmbuttonup wm_ncmbuttondblclk  wm_ncxbuttondown wm_ncxbuttonup wm_ncxbuttondblclk  wm_ncmousehover wm_ncmouseleave 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -