win12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
WinDefWindowProc (1.2)
Overview                                            Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINWINDOWMGR
 
MRESULT WinDefWindowProc(hwnd, msg, mp1, mp2)
HWND hwnd;     /* handle of the window */
USHORT msg;    /* message              */
MPARAM mp1;    /* message parameter    */
MPARAM mp2;    /* message parameter    */
 
The WinDefWindowProc function calls the default window procedure. The
default window procedure provides default processing for any window messages
that an application does not process. This function is used to ensure that
every message is processed. It should be called with the same parameters as
those received by the window procedure.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hwnd       Identifies the window that received the message.
 
msg        Specifies the message.
 
mp1        Specifies message parameter 1.
 
mp2        Specifies message parameter 2.
 
Return Value
 
The return value is dependent on the message that was passed to this
function.
 
Example
 
This example shows a typical window procedure. A switch statement is used to
process individual messages. All messages not processed are passed on to the
WinDefWindowProc function.
 
MRESULT EXPENTRY GenericWndProc(hwnd, usMessage, mp1, mp2)
HWND   hwnd;
USHORT usMessage;
MPARAM mp1;
MPARAM mp2;
{
    switch (usMessage) {
 
        /*
         * Process whatever messages you want here and send the rest
         * to WinDefWindowProc.
         */
 
        default:
            return (WinDefWindowProc(hwnd, usMessage, mp1, mp2));
    }
}
 
See Also
 
WinDefAVioWindowProc, WinDefDlgProc