• Welcome to Valhalla Legends Archive.
 

C++ Quick WM_Message question

Started by LordVader, September 02, 2004, 07:27 PM

Previous topic - Next topic

LordVader

When you click the "minimize" button uptop right of an application does that send a specific WM_message command that can be interprited so can make it also:

ShowWindow(hwnd, SW_HIDE);


WM_MINIMIZE? looked at msdn WM_Message list didn't see anything like that heh

Nvm Found it:
WM_SYSCOMMAND:

SC_CLOSE   Close the CWnd object.
SC_HOTKEY   Activate the CWnd object associated with the application-specified hot key. The low-order word of lParam identifies the HWND of the window to activate.
SC_HSCROLL   Scroll horizontally.
SC_KEYMENU   Retrieve a menu through a keystroke.
SC_MAXIMIZE (or SC_ZOOM)   Maximize the CWnd object.
SC_MINIMIZE (or SC_ICON)   Minimize the CWnd object.
SC_MOUSEMENU   Retrieve a menu through a mouse click.
SC_MOVE   Move the CWnd object.
SC_NEXTWINDOW   Move to the next window.
SC_PREVWINDOW   Move to the previous window.
SC_RESTORE   Restore window to normal position and size.
SC_SCREENSAVE   Executes the screen-saver application specified in the [boot] section of the SYSTEM.INI file.
SC_SIZE   Size the CWnd object.
SC_TASKLIST   Execute or activate the Windows Task Manager application.
SC_VSCROLL   Scroll vertically.


By default, OnSysCommand carries out the Control-menu request for the predefined actions specified in the preceding table.

In WM_SYSCOMMAND messages, the four low-order bits of the nID parameter are used internally by Windows. When an application tests the value of nID, it must combine the value 0xFFF0 with the nID value by using the bitwise-AND operator to obtain the correct result.

UserLoser.

#1
WM_SIZE is what you're looking for.  If (wParam == SIZE_MINIMIZED), then window is minimized.  There's also SIZE_MAXIMIZED (when it becomes maximized, obviously), and a few others, iirc.

Edit: Typo.

LordVader