winapi - How to set focus correctly when deal with wm_nclbuttondown? -
i want create window dismiss when lose focus in wm_nclbuttondown handler, firefox's menu button window does. didn't manage it. new window lose focus after creation.
so digged spy++ , found wm_nclbuttondown cause main window focused, here messages logged spy++:
in 0xb13f2 main window's hwnd, , 0x46139a new window hwnd.
then how set focus correctly?
i tried lot methods:
- pre-translate wm_nclbuttdown wm_lbuttondown.
- nchittest window area htclient , try handle move , resize manually, modification huge continue.
- in wm_nclbuttondown handler, sendmessage wm_lbuttondown.
- call setfocus lot.
...
some works, bring other problems. used spy++ log messages of firefox, , found make nchittest return htclient in area need handle left button down message.
Comments
Post a Comment