Jump to content

WndProc: Difference between revisions

From EDM2
No edit summary
 
Line 19: Line 19:


==Example Code==
==Example Code==
</PRE>
<PRE>
#define INCL_WINMESSAGEMGR /* Or use INCL_WIN, INCL_PM, Also in COMMON section */
#define INCL_WINMESSAGEMGR /* Or use INCL_WIN, INCL_PM, Also in COMMON section */
#include <os2.h>
#include <os2.h>

Latest revision as of 19:45, 13 April 2025

This defines the window procedure provided by an application.

Syntax

WndProc(hwnd, msg, mp1, mp2);

Parameters

hwnd (HWND) - input
Window handle.
msg (ULONG) - input
Message identity.
mp1 (MPARAM) - input
Message parameter 1.
mp2 (MPARAM) - input
Message parameter 2.

Returns

mresReply (MRESULT) - returns
Message-return data.

Remarks

This procedure is associated with a window by the pfnWndProc of the WinRegisterClass function.

The window procedure typically processes only some of the messages passed to it. Those messages it does not process must be passed on to the WinDefWindowProc function, which performs the standard window processing for those messages.

Example Code

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

HWND    hwnd;      /* Window handle. /
ULONG   msg;       / Message identity. /
MPARAM  mp1;       / Message parameter 1. /
MPARAM  mp2;       / Message parameter 2. /
MRESULT mresReply; / Message-return data. */

mresReply = WndProc(hwnd, msg, mp1, mp2);