Skip to content

Latest commit

 

History

History
135 lines (86 loc) · 4.91 KB

nf-winuser-dispatchmessagew.md

File metadata and controls

135 lines (86 loc) · 4.91 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name req.apiset
NF:winuser.DispatchMessageW
DispatchMessageW function (winuser.h)
The DispatchMessageW (Unicode) function dispatches a message to a window procedure. It is typically used to dispatch a message retrieved by the GetMessage function.
DispatchMessage
DispatchMessage function [Windows and Messages]
DispatchMessageW
_win32_DispatchMessage
_win32_dispatchmessage_cpp
winmsg.dispatchmessage
winui._win32_dispatchmessage
winuser/DispatchMessage
winuser/DispatchMessageW
winmsg\dispatchmessage.htm
winmsg
VS|winui|~\winui\windowsuserinterface\windowing\messagesandmessagequeues\messagesandmessagequeuesreference\messagesandmessagequeuesfunctions\dispatchmessage.htm
08/02/2022
DispatchMessage, DispatchMessage function [Windows and Messages], DispatchMessageA, DispatchMessageW, _win32_DispatchMessage, _win32_dispatchmessage_cpp, winmsg.dispatchmessage, winui._win32_dispatchmessage, winuser/DispatchMessage, winuser/DispatchMessageA, winuser/DispatchMessageW
winuser.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
DispatchMessageW (Unicode) and DispatchMessageA (ANSI)
User32.lib
User32.dll
Windows
19H1
DispatchMessageW
winuser/DispatchMessageW
c++
APIRef
kbSyntax
DllExport
User32.dll
API-MS-Win-NTUser-IE-message-l1-1-0.dll
ie_shims.dll
API-MS-Win-RTCore-NTUser-Window-l1-1-0.dll
minuser.dll
Ext-MS-Win-NTUser-message-l1-1-0.dll
Ext-MS-Win-NTUser-message-l1-1-1.dll
Ext-MS-Win-RTCore-NTUser-Window-Ext-l1-1-0.dll
Ext-MS-Win-NTUser-Message-l1-1-2.dll
Ext-MS-Win-NTUser-Message-L1-1-3.dll
DispatchMessage
DispatchMessageA
DispatchMessageW
ext-ms-win-ntuser-message-l1-1-0 (introduced in Windows 8)

DispatchMessageW function

-description

Dispatches a message to a window procedure. It is typically used to dispatch a message retrieved by the GetMessage function.

-parameters

-param lpMsg [in]

Type: const MSG*

A pointer to a structure that contains the message.

-returns

Type: LRESULT

The return value specifies the value returned by the window procedure. Although its meaning depends on the message being dispatched, the return value generally is ignored.

-remarks

The MSG structure must contain valid message values. If the lpmsg parameter points to a WM_TIMER message and the lParam parameter of the WM_TIMER message is not NULL, lParam points to a function that is called instead of the window procedure.

Note that the application is responsible for retrieving and dispatching input messages to the dialog box. Most applications use the main message loop for this. However, to permit the user to move to and to select controls by using the keyboard, the application must call IsDialogMessage. For more information, see Dialog Box Keyboard Interface.

Examples

For an example, see Creating a Message Loop.

Note

The winuser.h header defines DispatchMessage as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

Conceptual

GetMessage

IsDialogMessage

MSG

Messages and Message Queues

PeekMessage

Reference

TranslateMessage

WM_TIMER