user541686
user541686

Reputation: 210445

What's the difference between wParam WM_NOTIFY and idFrom in NMHDR?

The documentation for WM_NOTIFY says:

  • wParam:
    The identifier of the common control sending the message. This identifier is not guaranteed to be unique. An application should use the hwndFrom or idFrom member of the NMHDR structure (passed as the lParam parameter) to identify the control.

And the documentation for NMHDR says:

  • idFrom
    An identifier of the control sending the message.

What exactly is the difference between these two?

Upvotes: 5

Views: 767

Answers (1)

Raymond Chen
Raymond Chen

Reputation: 45173

There is in general no difference. It's a convenience. The same convenience that you get in the WM_COMMAND message, which passes both an ID and a window handle, even though you can derive the ID from the window handle via GetDlgCtrlID.

Upvotes: 4

Related Questions