If you don't tell the compiler otherwise (by using an explicit calling convention or a command line switch) then the compiler will use __cdecl. So your first version is actually
LRESULT __cdecl WndProc(...)
Part of the calling convention is who cleans up the stack. In the __cdecl case, the called function cleans the stack up before it returns. In the __stdcall case, the caller cleans it up after the function returns.
If you call a __cdecl function as if it was __stdcall then the stack clean-up will get messed up and you program will have problems!
For this reason you should never use a WNDPROC cast as you are above, or do a similar thing with other function pointer types.