6 BOOL
FileOpen(HWND hWnd
)
8 char filename
[80] = "test.c";
9 OPENFILENAME ofn
= { sizeof(OPENFILENAME
),
10 hWnd
, NULL
, "C code\0*.c\0", NULL
, 0, 0, filename
, 80,
11 NULL
, 0, NULL
, NULL
, OFN_CREATEPROMPT
|
12 OFN_SHOWHELP
, 0, 0, NULL
, 0, NULL
};
13 return GetOpenFileName(&ofn
);
16 BOOL CALLBACK
DlgProc(HWND hWnd
,UINT msg
,WPARAM wParam
,LPARAM lParam
)
30 LRESULT
WndProc (HWND wnd
, UINT msg
, WPARAM w
, LPARAM l
)
37 CreateDialogIndirect(0,hello3res_DIALOG_DIADEMO
.bytes
,wnd
,(WNDPROC
)DlgProc
);
41 BITMAPINFO
*bm
=(BITMAPINFO
*)hello3res_BITMAP_BITDEMO
.bytes
;
44 bits
+=bm
->bmiHeader
.biSize
;
45 bits
+=(1<<bm
->bmiHeader
.biBitCount
)*sizeof(RGBQUAD
);
46 SetDIBitsToDevice(hdc
,0,0,bm
->bmiHeader
.biWidth
,
47 bm
->bmiHeader
.biHeight
,0,0,0,bm
->bmiHeader
.biHeight
,
48 bits
,bm
,DIB_RGB_COLORS
);
56 return DefWindowProc (wnd
, msg
, w
, l
);
63 return DefWindowProc (wnd
, msg
, w
, l
);
68 int PASCAL
WinMain (HANDLE inst
, HANDLE prev
, LPSTR cmdline
, int show
)
73 char className
[] = "class"; /* To make sure className >= 0x10000 */
74 char winName
[] = "Test app";
77 class.style
= CS_HREDRAW
| CS_VREDRAW
;
78 class.lpfnWndProc
= WndProc
;
81 class.hInstance
= inst
;
82 class.hIcon
= LoadIcon (0, IDI_APPLICATION
);
83 class.hCursor
= LoadCursor (0, IDC_ARROW
);
84 class.hbrBackground
= GetStockObject (WHITE_BRUSH
);
85 class.lpszMenuName
= 0;
86 class.lpszClassName
= (SEGPTR
)className
;
88 if (!RegisterClass (&class))
91 wnd
= CreateWindow (className
, winName
, WS_OVERLAPPEDWINDOW
,
92 CW_USEDEFAULT
, 0, CW_USEDEFAULT
, 0, 0,
93 LoadMenu(inst
,"MAIN"), inst
, 0);
94 ShowWindow (wnd
, show
);
97 while (GetMessage (&msg
, 0, 0, 0)){
98 TranslateMessage (&msg
);
99 DispatchMessage (&msg
);