Archived

This topic is now archived and is closed to further replies.

Normie

WmdProc Parameters

Recommended Posts

OK, as of a few months ago, whenever I went to make a windows app, I used a template for the WinMain() and WndProc() functions. I can tell you the parameters for the WndProc by heart (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam), and I know what the first two represent, but what the hell do the WPARAM and LPARAM represent? -Normie "But time flows like a river... and history repeats." ... So...what about beaver dams?

Share this post


Link to post
Share on other sites
They are the the parameters of the message. For example, if Windows sends you a WM_KEYDOWN message, then it needs some way to tell you what key was pressed, right? It puts this kind of info in the params.

quote:
Original post by Normie
"But time flows like a river... and history repeats."
...
So...what about beaver dams?


From SoM, right?

Share this post


Link to post
Share on other sites
In the bad old days of 16-bit Windows wParam was a WORD and lParam was a LONG. Hence the names.

Just about every windows message has some sort of miscellaneous data associated with it. However every message has different data. So wParam and lParam are just generic placeholders and you have to cast them to the right type for the message.

-Mike

btw, wParam and lParam are an excellent example of how hungarian notation breaks down as a project evolves....

Share this post


Link to post
Share on other sites