Holy cow, I wrote a book!
The WM_NOTIFY message takes the following parameters:
Notice that the identifier of the control sending the message appears
in two places,
once in the wParam and again in the
What's the difference?
There is no difference.
It's just a convenience.
The same value is passed in both places, and you can check whichever
one is easier for you.
You might use the wParam because it avoids having to
dereference a pointer.
You might use the NMHDR because that way you have only
one thing to pass to your OnNotify helper function.
Whatever floats your boat.
Passing the same information multiple ways is hardly new.
The WM_COMMAND message also passes redundant
The control identifier is passed in the low word of the
and you can also get it by calling
GetDlgCtrlID on the window handle
passed in the lParam.