2
* This file has no copyright assigned and is placed in the Public Domain.
3
* This file is part of the w64 mingw-runtime package.
4
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
6
#ifndef WIN32_LEAN_AND_MEAN
7
#define WIN32_LEAN_AND_MEAN
11
#define TITLE "WinMain"
17
LRESULT CALLBACK WindowProc(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam)
31
return DefWindowProc(hWnd,Msg,wParam,lParam);
36
char szClassName[] = "WinMain";
38
int WINAPI WinMain(HINSTANCE hThisInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
44
wincl.hInstance = hThisInstance;
45
wincl.lpszClassName = szClassName;
46
wincl.lpfnWndProc = WindowProc;
47
wincl.style = CS_OWNDC | CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
48
wincl.cbSize = sizeof(WNDCLASSEX);
50
wincl.hIcon = LoadIcon(NULL,IDI_APPLICATION);
51
wincl.hIconSm = LoadIcon(NULL,IDI_APPLICATION);
52
wincl.hCursor = LoadCursor(NULL,IDC_ARROW);
53
wincl.lpszMenuName = NULL;
56
wincl.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);;
58
if (!RegisterClassEx(&wincl)) return 0;
60
hwnd = CreateWindowEx(0, szClassName, TITLE, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, WIDTH, HEIGHT,
61
HWND_DESKTOP, NULL, hThisInstance, NULL);
63
ShowWindow(hwnd,nCmdShow);
65
while (GetMessage(&messages,NULL,0,0))
67
TranslateMessage(&messages);
68
DispatchMessage(&messages);
70
return (int)messages.wParam;
76
pinsel = CreateSolidBrush(RGB(255,255,0));
77
Rectangle(hdc,10,10,110,110);
78
TextOut(hdc,15,45,"Hello, World!",13);
80
SelectObject(hdc,pinsel);
81
Ellipse(hdc,100,100,200,200);
82
Arc(hdc,120,120,180,180,100,200,200,200);
83
SetPixel(hdc,130,140,0);
84
SetPixel(hdc,170,140,0);
85
MoveToEx(hdc,150,100,0);