DispatchMessage

  LONG DispatchMessage(lpmsg)    
  CONST MSG *lpmsg; /* address of structure with message */

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

Parameters

lpmsg

Points to an MSG structure that contains the message. The MSG structure has the following form:

typedef struct tagMSG { /* msg */

HWND hwnd;

UINT message;

WPARAM wParam;

LPARAM lParam;

DWORD time;

POINT pt;

} MSG;

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

Return Value

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

See Also

GetMessage, PeekMessage, PostAppMessage, PostMessage, TranslateMessage