Jump to content

WinDefWindowProc: Difference between revisions

From EDM2
Created page with "This function invokes the default window procedure. ==Syntax== WinDefWindowProc(hwnd, ulMsgid, mpParam1, mpParam2) ==Parameters== ;hwnd (HWND) - input :Window handle. ;ul..."
(No difference)

Revision as of 21:43, 6 August 2023

This function invokes the default window procedure.

Syntax

WinDefWindowProc(hwnd, ulMsgid, mpParam1, mpParam2)

Parameters

hwnd (HWND) - input
Window handle.
ulMsgid (ULONG) - input
Message identity.
mpParam1 (MPARAM) - input
Parameter 1.
mpParam2 (MPARAM) - input
Parameter 2.

Errors

Possible returns from WinGetLastError

PMERR_INVALID_HWND (0x1001)
An invalid window handle was specified.

Returns

mresReply (MRESULT) - returns
Message-return data.

Remarks

The default window provides default processing for any window messages that an application chooses not to process. It can be used to ensure that every message is processed. This function should be made with the same parameters as those received by the window procedure.

The action taken by the default window procedure, the values passed in mpParam1, mpParam2 and the values returned in mresReply are defined for each ulMsgid.

Example Code

This example uses the default window procedure, called by WinDefWindowProc, for default processing of non supported window messages.

#define INCL_WINWINDOWMGR       /* Window Manager Functions     */
#include <os2.h>

MRESULT GenericWndProc(HWND  hwnd, ULONG  ulMsgid, MPARAM mpParam1,
                      MPARAM mpParam2)
{
switch(ulMsgid)
   {
   /*
   .
   . process user supported messages
   .
   */

   default:
     return (WinDefWindowProc(hwnd, ulMsgid, mpParam1, mpParam2));
   }
}

Definition

#define INCL_WINWINDOWMGR /* Or use INCL_WIN, INCL_PM, Also in COMMON section */
#include <os2.h>

HWND       hwnd;       /*  Window handle. */
ULONG      ulMsgid;    /*  Message identity. */
MPARAM     mpParam1;   /*  Parameter 1. */
MPARAM     mpParam2;   /*  Parameter 2. */
MRESULT    mresReply;  /*  Message-return data. */

mresReply = WinDefWindowProc(hwnd, ulMsgid, mpParam1, mpParam2);

Related Functions