Default Frame-Window Behavior

The following table lists all the messages specifically handled by the window procedure of the predefined frame-window class (WC_FRAME) and describes how the window procedure responds to each message.

┌────────────────────┬────────────────────────────────────────┐
│Message             │Description                             │
├────────────────────┼────────────────────────────────────────┤
│WM_ACTIVATE         │Sets the highlighted state of the title │
│                    │bar or border so that it matches the    │
│                    │frame window's activation state.        │
├────────────────────┼────────────────────────────────────────┤
│WM_BUTTON1DOWN      │If the frame window is minimized,       │
│                    │captures the mouse; otherwise, activates│
│                    │the frame window.                       │
├────────────────────┼────────────────────────────────────────┤
│WM_BUTTON2DOWN      │Activates the frame window.             │
├────────────────────┼────────────────────────────────────────┤
│WM_BUTTON3DOWN      │Activates the frame window.             │
├────────────────────┼────────────────────────────────────────┤
│WM_BUTTON1UP        │Processes messages from minimized window│
│                    │frames.                                 │
├────────────────────┼────────────────────────────────────────┤
│WM_BUTTON1DBLCLK    │If the frame window is minimized, posts │
│                    │a WM_SYSCOMMAND message to itself;      │
│                    │otherwise, activates the frame window.  │
├────────────────────┼────────────────────────────────────────┤
│WM_CALCVALIDRECTS   │If the frame window has no client window│
│                    │or if the client window has the         │
│                    │CS_SIZEREDRAW style, returns the        │
│                    │CVR_REDRAW flag to invalidate the entire│
│                    │window.                                 │
├────────────────────┼────────────────────────────────────────┤
│WM_CLOSE            │If the frame window has a client window,│
│                    │passes this message to the client;      │
│                    │otherwise, returns the result of        │
│                    │WinDefWindowProc.                       │
├────────────────────┼────────────────────────────────────────┤
│WM_CREATE           │Creates the specified frame controls by │
│                    │calling WinCreateFrameControls. Also    │
│                    │creates any accelerator tables, loads   │
│                    │icons, and adds itself to the Window    │
│                    │List. These actions depend on the       │
│                    │frame-window styles and frame-control   │
│                    │flags specified for the window.         │
├────────────────────┼────────────────────────────────────────┤
│WM_DESTROY          │If the focus is held by a child window  │
│                    │of the frame window, sets the focus to  │
│                    │the frame window's parent window,       │
│                    │destroys any owned windows or child     │
│                    │windows, destroys any icons created by  │
│                    │using the FS_ICON style, and destroys   │
│                    │any accelerator tables created by using │
│                    │the FS_ACCELTABLE style.                │
├────────────────────┼────────────────────────────────────────┤
│WM_ENABLE           │Returns the result of WinDefWindowProc. │
├────────────────────┼────────────────────────────────────────┤
│WM_ERASEBACKGROUND  │Returns TRUE, signaling that the window │
│                    │should erase the client-window area. The│
│                    │frame window sends this message to      │
│                    │itself during WM_PAINT processing.      │
├────────────────────┼────────────────────────────────────────┤
│WM_FORMATFRAME      │Calculates the sizes and positions of   │
│                    │the frame controls and the client       │
│                    │window.                                 │
├────────────────────┼────────────────────────────────────────┤
│WM_HITTEST          │If the frame window is minimized and    │
│                    │disabled, returns HT_ERROR; otherwise,  │
│                    │returns TF_MOVE.                        │
├────────────────────┼────────────────────────────────────────┤
│WM_MINMAXFRAME      │If the frame window has a client window,│
│                    │passes this message to the client       │
│                    │window; otherwise, passes this message  │
│                    │to WinDefWindowProc.                    │
├────────────────────┼────────────────────────────────────────┤
│WM_MOUSEMOVE        │Determines the correct mouse pointer to │
│                    │use and returns the result of           │
│                    │WinDefWindowProc.                       │
├────────────────────┼────────────────────────────────────────┤
│WM_PAINT            │If the frame window is minimized, sends │
│                    │WM_QUERYICON and WM_ERASEBACKGROUND to  │
│                    │itself and draws the icon; otherwise,   │
│                    │paints the control windows, sends a     │
│                    │WM_ERASEBACKGROUND message to the client│
│                    │window, and paints the client window.   │
├────────────────────┼────────────────────────────────────────┤
│WM_QUERYTRACKINFO   │Starts track-move processing of the     │
│                    │title-bar control window.               │
├────────────────────┼────────────────────────────────────────┤
│WM_SHOW             │Returns the result of WinDefWindowProc. │
├────────────────────┼────────────────────────────────────────┤
│WM_SIZE             │Sends a WM_FORMATFRAME message to       │
│                    │itself.                                 │
├────────────────────┼────────────────────────────────────────┤
│WM_SYSCOMMAND       │If the frame window has captured the    │
│                    │mouse, ignores the system command;      │
│                    │otherwise, uses one of the following    │
│                    │commands: SC_APPMENU, SC_CLOSE, SC_MOVE,│
│                    │SC_NEXT, SC_NEXTFRAME, SC_RESTORE,      │
│                    │SC_SIZE, SC_SYSMENU, SC_TASKMANAGER.    │
├────────────────────┼────────────────────────────────────────┤
│WM_UPDATEFRAME      │Reformats and updates the appearance of │
│                    │the frame window. Sent after a frame    │
│                    │control has been added to or removed    │
│                    │from the frame window.                  │
└────────────────────┴────────────────────────────────────────┘


[Back: Nonstandard Frame Windows]
[Next: Using Frame Windows]