Export (0) Print
Expand All
MFC
Expand Minimize
This topic has not yet been rated - Rate this topic

CWnd::SendDlgItemMessage 

Sends a message to a control.


LRESULT SendDlgItemMessage(
   int nID,
   UINT message,
   WPARAM wParam = 0,
   LPARAM lParam = 0 
);

Parameters

nID

Specifies the identifier of the dialog control that will receive the message.

message

Specifies the message to be sent.

wParam

Specifies additional message-dependent information.

lParam

Specifies additional message-dependent information.

Specifies the value returned by the control's window procedure, or 0 if the control was not found.

The SendDlgItemMessage member function does not return until the message has been processed.

Using SendDlgItemMessage is identical to obtaining a CWnd* to the given control and calling the SendMessage member function.

BOOL CMyDlg::OnInitDialog() 
{
   CDialog::OnInitDialog();

   //set the min and max range of the up/down or spin control
   SendDlgItemMessage(IDC_SPIN1, UDM_SETRANGE, 0, (LPARAM) MAKELONG (8, 1));

   return TRUE;  // return TRUE unless you set the focus to a control
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.