I have a top-level window that was created with WS_POPUP
/ WS_EX_APPWINDOW
so it uses non-standard frame and its caption appears on taskbar.
Yet I have custom WM_NCHITTEST
handler if that matters.
When the window is "collapsed to taskbar" (removed from screen) and user clicks on its icon/caption on taskbar the window is getting WM_QUERYOPEN
message and gets opened by DefWindowProc.
But when the window is opened and user clicks on its icon/caption in taskbar the window just gets deactivated - I need to collapse it.
Are there any messages sent by shell to the window when mouse is on its caption in taskbar?
I am trying to reproduce standard Windows Shell behavior - first click on taskbar's window icon reveals the window and second click - hides it. First part (revealing) works by default but not the second (hiding).
UPDATE: Here are messages that my window gets when it is on screen and user clicks on its caption in taskbar:
<01287> 00150DAE S WM_NCACTIVATE fActive:False
<01288> 00150DAE R WM_NCACTIVATE fDeactivateOK:True
<01289> 00150DAE S WM_ACTIVATE fActive:WA_INACTIVE fMinimized:False hwndPrevious:(null)
<01290> 00150DAE R WM_ACTIVATE
<01291> 00150DAE S WM_ACTIVATEAPP fActive:False dwThreadID:000041EC
<01292> 00150DAE R WM_ACTIVATEAPP
<01293> 00150DAE S WM_KILLFOCUS hwndGetFocus:(null)
<01294> 00150DAE R WM_KILLFOCUS
<01295> 00150DAE S WM_IME_SETCONTEXT fSet:0 iShow:C000000F
<01296> 00150DAE S WM_IME_NOTIFY dwCommand:IMN_CLOSESTATUSWINDOW dwCommand:00000001 dwData:00000000
<01297> 00150DAE R WM_IME_NOTIFY
<01298> 00150DAE R WM_IME_SETCONTEXT
Window styles: WS_POPUP | WS_VISIBLE | WS_SYSMENU
Window ex-styles: WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_APPWINDOW
If that matters the window looks like this:
That's just a test.
SWP_STATECHANGED
flag. – IInspectable