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++:

enter image description here

in 0xb13f2 main window's hwnd, , 0x46139a new window hwnd.

then how set focus correctly?

i tried lot methods:

  1. pre-translate wm_nclbuttdown wm_lbuttondown.
  2. nchittest window area htclient , try handle move , resize manually, modification huge continue.
  3. in wm_nclbuttondown handler, sendmessage wm_lbuttondown.
  4. 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

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -