#include <windows.h>
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCMdShow)
{
MSG msg;
WNDCLASS wc = {0};
wc.lpszClassName = TEXT("My Window");
wc.hInstance = hInstance;
wc.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
wc.lpfnWndProc = WNDPROC;
wc.hCursor = LoadCursor(0, IDC_ARROW);
RegisterClass(&wc);
CreateWindow(wc.lpszClassName, TEXT("Our First Window!"), WS_VISIBLE|WS_OVERLAPPEDWINDOW, 100, 100, 500, 500, hInstance, 0);
while(GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (int) msg.wPARAM;
switch(msg)
{
case WM_CREATE:
{
break;
}
case WM_COMMAND:
{}
break;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
}
But I get a few errors. These are:
Capture.PNG 24.82K
26 downloadsI followed a tutorial in the tutorials section.
i pretty much copied the code exactly
Where have i gone wrong?


Sign In
Create Account


Back to top









