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