Is there a WM_QUERYHIDE / CLOSE or similar message?

I have a top-level window that was created with WS_POPUP/ WS_EX_APPWINDOW, so it uses a custom frame and its title appears on the taskbar. However, I have a custom WM_NCHITTESThandler, if that matters.

When the window is “reset to the taskbar” (removed from the screen), and the user clicks on the icon / signature on the taskbar, the window receives a message WM_QUERYOPENand DefWindowProc opens.

But when the window is open and the user clicks on the icon / signature on the taskbar, the window simply deactivates - I need to minimize it.

Are there any messages sent by the shell to the window when the mouse pointer is in the header on the taskbar?

I am trying to reproduce the standard behavior of Windows Shell - first click the window icon of the taskbar, showing the window, and the second click hides it. The first part (expansion) works by default, but not the second (hides).

UPDATE: here are displayed the messages that my window appears when it is displayed on the screen, and the user clicks on the title in the 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

Ex-styles window: WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_APPWINDOW

If this is important, the window looks like this:

enter image description here

This is just a test.

+4
source share
1 answer

You can try adding WS_MINIMIZEBOX to the window style, for example: WS_POPUP | WS_MINIMIZEBOX.

+2
source

Source: https://habr.com/ru/post/1655994/


All Articles