Using SendMessage() As Opposed to SendDlgItemMessage()Last reviewed: November 2, 1995Article ID: Q12273 |
The information in this article applies to:
The following information describes under what circumstances it is appropriate to use either the SendMessage() or SendDlgItemMessage() function. Both SendMessage() and SendDlgItemMessage() can be used to add strings to a list box. SendMessage() is used to send a message to a specific window using the handle to the list box. SendDlgItemMessage() is used to send a message to the child window of a given window using the list box resource ID. SendDlgItemMessage() is most often used in dialog box functions that have a handle to the dialog box and not to the child window control. The SendDlgItemMessage() call
SendDlgItemMessage (hwnd, id, msg, wParam, lParam)is equivalent to the following SendMessage() call:
hwnd2 = GetDlgItem (hwnd, id); SendMessage (hwnd2, msg, wParam, lParam);Please note that PostMessage() should never be used to talk to the child windows of dialog boxes for the following reasons:
|
Additional reference words: 3.00 3.10 3.50
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |