Skip to main content
gamedev.net
🔒 Locked

WmdProc Parameters

Started by Normie 1 reply 400+ views
Original Post
Normie
Normie
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?
I am a devout follower of the"Lazy Programmer's Doctrime"(tm)...and I'm damned proud of it, too!-----"I came, I saw, I started makinggames." ... If you'll excuseme, I must resume my searchfor my long lost lobotomy stitches.
TookH
TookH
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?
"It tastes like burning..."
Anon Mike
Anon Mike
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....
-Mike

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.