Question

In trying to get a grasp on creating windows (in Windows OS), I encountered this function definition

LRESULT CALLBACK Window::MsgRouter(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)

(taken from here)

Me being only a beginner in C++ I interpreted that to mean that it's return type was both LRESULT and CALLBACK

Is CALLBACK some special type? My other question is, what is a WPARAM and an LPARAM?

Thanks in advance, ell.

Was it helpful?

Solution

No, it's not a type, it's a modifier. Both CALLBACK and WINAPI resolve to __stdcall, which is standard calling convention for WinAPI functions.

WPARAM and LPARAM are message parameters' types, all types used in the API are documented on MSDN.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top