Jump to content

WndProc

From EDM2
Revision as of 19:45, 13 April 2025 by Martini (talk | contribs) (Created page with "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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

  1. define INCL_WINMESSAGEMGR /* Or use INCL_WIN, INCL_PM, Also in COMMON section */
  2. 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);