June 2001
Intermediate to advanced
706 pages
24h 10m
English
SendDlgItemMessage
SendDlgItemMessage operates similarly to SendMessage. Both functions are synchronous, and both return a value that depends on the message sent. The main difference between these two functions is that you can specify a control ID in SendDlgItemMessage. This allows a message to be sent to a control when you know its ID but not its hwnd:
Public Declare Function SendDlgItemMessage Lib "user32" _
Alias "SendDlgItemMessageA" _
(ByVal hDlg As Long, ByVal nIDDlgItem As Long, _
ByVal wMsg As Long, ByVal wParam As Long, _
ByVal lParam As Long) As LonghDlg
The handle of the target dialog box.
nIDDlgItem
The ID of the control on the dialog box specified by the
hDlg handle. You can find the control ID
by using Spy++.
wMsg
The message to send to the target window.
wParam
The first parameter of the message.
lParam
The second parameter of the message.
The return value depends on the message sent.
Read now
Unlock full access