Which is preferred, method 1 or method 2?
LRESULT CALLBACK wpMainWindow(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (
You can't know at what point the stack reservation is done.
For readability I would go with C99 (or C++). That allows you the declaration of a variable really there where first use it.
HDC hdc = BeginPaint(hwnd, &ps);