4 BOOL CALLBACK
DlgProc(HWND hWnd
,UINT msg
,WPARAM wParam
,LPARAM lParam
)
18 LRESULT
WndProc (HWND wnd
, UINT msg
, WPARAM w
, LPARAM l
)
25 CreateDialogIndirect(0,hello3_DIALOG_DIADEMO
.bytes
,wnd
,(WNDPROC
)DlgProc
);
29 BITMAPINFO
*bm
=hello3_BITMAP_BITDEMO
.bytes
;
32 bits
+=bm
->bmiHeader
.biSize
;
33 bits
+=(1<<bm
->bmiHeader
.biBitCount
)*sizeof(RGBQUAD
);
34 SetDIBitsToDevice(hdc
,0,0,bm
->bmiHeader
.biWidth
,
35 bm
->bmiHeader
.biHeight
,0,0,0,bm
->bmiHeader
.biHeight
,
36 bits
,bm
,DIB_RGB_COLORS
);
41 return DefWindowProc (wnd
, msg
, w
, l
);
48 return DefWindowProc (wnd
, msg
, w
, l
);
53 int PASCAL
WinMain (HANDLE inst
, HANDLE prev
, LPSTR cmdline
, int show
)
60 class.style
= CS_HREDRAW
| CS_VREDRAW
;
61 class.lpfnWndProc
= WndProc
;
64 class.hInstance
= inst
;
65 class.hIcon
= LoadIcon (0, IDI_APPLICATION
);
66 class.hCursor
= LoadCursor (0, IDC_ARROW
);
67 class.hbrBackground
= GetStockObject (WHITE_BRUSH
);
68 class.lpszMenuName
= 0;
69 class.lpszClassName
= (SEGPTR
)"class";
71 if (!RegisterClass (&class))
74 wnd
= CreateWindow ("class", "Test app", WS_OVERLAPPEDWINDOW
,
75 CW_USEDEFAULT
, 0, CW_USEDEFAULT
, 0, 0,
76 LoadMenuIndirect(hello3_MENU_MAIN
.bytes
), inst
, 0);
77 ShowWindow (wnd
, show
);
80 while (GetMessage (&msg
, 0, 0, 0)){
81 TranslateMessage (&msg
);
82 DispatchMessage (&msg
);