2 classes before function definition

what is the meaning of two types/classes before function name or is that something else?

thanks

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg)
    {
    case WM_DESTROY:
        PostQuitMessage(0);
        return 0;

    case WM_PAINT:
        {
            PAINTSTRUCT ps;
            HDC hdc = BeginPaint(hwnd, &ps);

            FillRect(hdc, &ps.rcPaint, (HBRUSH) (COLOR_WINDOW+1));

            EndPaint(hwnd, &ps);
        }
        return 0;

    }
    return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
'LRESULT' is a type cast to an otherwise obscure number. Microsoft does this kind of thing a lot so that you have an idea of what kind of result the return type represents. 'CALLBACK' is a function calling convention, this describes how the function is to be called to the compiler. The C++ standard only mandates the support of two calling conventions, C and C++. But Microsoft compilers and a few others add more to this.
Topic archived. No new replies allowed.