View Full Version: Win32 Programming

C++ Learning Community > C++ Help > Win32 Programming


Title: Win32 Programming


Dragon - June 24, 2003 09:25 PM (GMT)
I can now create win32 GUI applications in C++. However, even though I can write the code, there are somethings that I'm not exactly clear on.

In the LRESULT CALLBACK WndProc(...), what is HWND? Also, what is WPARAM and LPARAM? Hopefully someone like Xception can help. :)

Xception - June 24, 2003 09:45 PM (GMT)
It's a callback procedure/function. That means Windows calls it everytime a certain event happens and passes these parameters to the function:
HWND is the handle to the window of the callback function, the same you get with CreateWindow(EX)
UINT message is the message identifier, the message which called the callback function is stored there, for example WM_PAINT
WPARAM and LPARAM are message parameters, the values stored there depend on the message:for example WM_KEYDOWN - WPARAM=Virtual keycode,LPARAM=extended keycode

Dragon - June 24, 2003 11:24 PM (GMT)
Alright. Thanks Xception.




* Hosted for free by InvisionFree