0

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.

Ell
  • 4,238
  • 6
  • 34
  • 60
  • 1
    The page you link is somewhat outdated; you should use [`GetWindowLongPtr()`](http://msdn.microsoft.com/en-us/library/ms633585.aspx) and [`SetWindowLongPtr()`](http://msdn.microsoft.com/en-us/library/ms644898.aspx) instead of `GetWindowLong()` and `SetWindowLong()` if you want your code to work with both 32-bit and 64-bit pointers. – In silico Dec 31 '10 at 16:33

1 Answers1

3

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.

Cat Plus Plus
  • 125,936
  • 27
  • 200
  • 224