DialogProc

  LRESULT CALLBACK DialogProc(hDlg, wMsg, wParam, lParam)    
  HWND hDlg; /* handle of the dialog box */
  UINT wMsg; /* message */
  WPARAM wParam; /* first message parameter */
  LPARAM lParam; /* second message parameter */

The DialogProc function is an application-defined callback function that processes messages sent to a modeless dialog box.

Parameters

hDlg

Identifies the dialog box.

wMsg

Specifies the message.

wParam

Specifies additional message information. The contents of this parameter depend on the message being sent.

lParam

Specifies additional message information. The contents of this parameter depend on the message being sent.

Return Value

Except in response to the WM_INITDIALOG message, the dialog procedure should return nonzero if it processes the message, and zero if it does not. In response to a WM_INITDIALOG message, the dialog procedure should return zero if it calls the SetFocus function to set the focus to one of the controls in the dialog box. Otherwise, it should return nonzero, in which case the system will set the focus to the first control in the dialog box that can be given the focus.

Comments

The dialog procedure is used only if the dialog class is used for the dialog box. This is the default class and is used if no explicit class is given in the dialog-box template. Although the dialog procedure is similar to a window procedure, it must not call the DefWindowProc function to process unwanted messages. Unwanted messages are processed internally by the dialog-class window procedure.

DialogProc is a placeholder for the application-supplied function name.

See Also

CreateDialog, CreateDialogIndirect, CreateDialogIndirectParam, CreateDialogParam, DefWindowProc, SetFocus