It looks like the IDE mentioned works for most compilers, but it also seems to use MinGW in the installation instructions on the wiki.
If it won't compile at all, maybe you need to get a compiler?
Otherwise, the code I posted likely works on all compilers.
Unposted-but-still-edit:
Found a tiny bit I forgot to clip out.
Also, tested MSVC++ 2008, and after removing that unneeded bit, it compiled fine.
So, with both MinGW and MSVC(++? It was compiled as a .c...) compiling fine, I can assume that it is, though not cross-platform, at least generally compatible with a variety of compilers.
#include <stdio.h>
#include <windows.h>
int width=256,height=256,quit=0;
HWND hwnd;
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_CLOSE:
PostQuitMessage(0);
break;
default:
return (DefWindowProc(hwnd, message, wParam, lParam));
}
return 0;
}
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
{
WNDCLASSEX windowClass;
MSG msg;
DWORD dwExStyle;
DWORD dwStyle;
windowClass.cbSize=sizeof(WNDCLASSEX);
windowClass.style= CS_HREDRAW|CS_VREDRAW;
windowClass.lpfnWndProc=WndProc;
windowClass.cbClsExtra=0;
windowClass.cbWndExtra=0;
windowClass.hInstance=hInstance;
windowClass.hIcon=LoadIcon(NULL, IDI_APPLICATION);
windowClass.hCursor=LoadCursor(NULL,IDC_ARROW);
windowClass.hbrBackground=NULL;
windowClass.lpszMenuName=NULL;
windowClass.lpszClassName="MyClass";
windowClass.hIconSm=LoadIcon(NULL,IDI_WINLOGO);
if (!RegisterClassEx(&windowClass))
{
return 1;
}
dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
dwStyle = WS_OVERLAPPEDWINDOW;
hwnd = CreateWindowEx(0,"MyClass","",WS_OVERLAPPEDWINDOW,200,100,width+8,height+34,NULL,NULL,hInstance,NULL);
if (!hwnd)
{
return 1;
}
ShowWindow(hwnd, SW_SHOW);
UpdateWindow(hwnd);
while(!quit)
{
while(PeekMessage(&msg, hwnd, 0,0, PM_REMOVE))
{
if (msg.message==WM_QUIT)quit=1;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return 0;
}