Which is preferred, method 1 or method 2?
LRESULT CALLBACK wpMainWindow(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch (
Define the variables in the narrowest scope where they are relevant. There's no reason to use Method 2 above in my opinion.
Stack space is only likely to be used when the variables are in scope. As @paxdiablo points out, your locals may wind up in registers rather than on the stack, if the compiler can find the space for them.