I've started following the series and on episode 2 at 50:20, my window is not resizable or dragable and is already white. There are also no WM_CLOSE messages when you click the close button.
From what I can tell I've written it out exactly the same(it's not the downloaded source)and checked it over and over and am completely baffled as to why it wouldn't work the same.
I'm using Windows 7 64
Emacs 23.4.1
Visual Studio 2015(14.0)
Just so you can see it and in case I'm blind, here is my code:
ps. I'm a complete beginner :)
#include <windows.h>
LRESULT CALLBACK
MainWindowCallback(HWND Window,
UINT Message,
WPARAM WParam,
LPARAM LParam)
{
LRESULT Result = 0;
switch(Message)
{
case WM_SIZE:
{
OutputDebugStringA("WM_SIZE\n");
} break;
case WM_DESTROY:
{
OutputDebugStringA("WM_DESTROY\n");
} break;
case WM_CLOSE:
{
OutputDebugStringA("WM_CLOSE\n");
} break;
case WM_ACTIVATEAPP:
{
OutputDebugStringA("WM_ACTIVATEAPP\n");
} break;
default:
{
//OutputDebugStringA("default\n");
Result = DefWindowProc(Window, Message, WParam, LParam);
} break;
}
return(Result);
}
int CALLBACK
WinMain(HINSTANCE Instance,
HINSTANCE PrevInstance,
LPSTR CommadLine,
int ShowCode)
{
WNDCLASS WindowClass = {};
WindowClass.style = CS_OWNDC|CS_HREDRAW|CS_VREDRAW;
WindowClass.lpfnWndProc = MainWindowCallback;
//WindowClass.cbClsExtra;
//WindowClass.cbWndExtra;
WindowClass.hInstance = Instance;
//WindowClass.hIcon;
//WindowClass.hCursor;
//WindowClass.hbrBackground;
//WindowClass.lpszMenuName;
WindowClass.lpszClassName = "HandmadeHeroWindowClass";
if(RegisterClass(&WindowClass))
{
HWND WindowHandle =
CreateWindowEx(
0,
WindowClass.lpszClassName,
"Handmade Hero",
WS_OVERLAPPEDWINDOW|WS_VISIBLE,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
0,
0,
Instance,
0);
if(WindowHandle)
{
for(;;)
{
MSG Message;
BOOL MessageResult = GetMessage(&Message, 0, 0, 0);
if(MessageResult > 0)
{
TranslateMessage(&Message);
}
else
{
break;
}
}
}
else
{
}
}
else
{
}
return(0);
}