1 /* #include "autoconf.h" */
4 void Write (HDC dc
, int x
, int y
, char *s
)
6 TextOut (dc
, x
, y
, s
, strlen (s
));
9 LONG
WndProc (HANDLE wnd
, UINT msg
, WORD w
, LONG l
)
11 static short xChar
, yChar
;
19 GetTextMetrics (dc
, &tm
);
20 xChar
= tm
.tmAveCharWidth
;
26 dc
= BeginPaint (wnd
, &ps
);
27 Write (dc
, xChar
, yChar
, "Hola");
36 return DefWindowProc (wnd
, msg
, w
, l
);
41 int PASCAL
WinMain (HANDLE inst
, HANDLE prev
, LPSTR cmdline
, int show
)
48 class.style
= CS_HREDRAW
| CS_VREDRAW
;
49 class.lpfnWndProc
= WndProc
;
52 class.hInstance
= inst
;
53 class.hIcon
= LoadIcon (0, IDI_APPLICATION
);
54 class.hCursor
= LoadCursor (0, IDC_ARROW
);
55 class.hbrBackground
= GetStockObject (WHITE_BRUSH
);
56 class.lpszMenuName
= NULL
;
57 class.lpszClassName
= "class";
59 if (!RegisterClass (&class))
62 wnd
= CreateWindow ("class", "Test app", WS_OVERLAPPEDWINDOW
,
63 CW_USEDEFAULT
, 0, CW_USEDEFAULT
, 0, 0,
65 ShowWindow (wnd
, show
);
68 while (GetMessage (&msg
, 0, 0, 0)){
69 TranslateMessage (&msg
);
70 DispatchMessage (&msg
);