15 BOOL
FileOpen(HWND hWnd
)
17 char filename
[80] = "test.c";
18 OPENFILENAME ofn
= { sizeof(OPENFILENAME
),
19 hWnd
, NULL
, "C code\0*.c\0", NULL
, 0, 0, filename
, 80,
20 NULL
, 0, NULL
, NULL
, OFN_CREATEPROMPT
|
21 OFN_SHOWHELP
, 0, 0, NULL
, 0, NULL
};
22 return GetOpenFileName(&ofn
);
25 BOOL CALLBACK
DlgProc(HWND hWnd
,UINT msg
,WPARAM wParam
,LPARAM lParam
)
39 LRESULT
WndProc (HWND wnd
, UINT msg
, WPARAM w
, LPARAM l
)
46 DialogBox(Globals
.hInstance
,
53 HBITMAP hBitmap
, hPrevBitmap
;
56 hBitmap
= LoadBitmapA (Globals
.hInstance
, "BITDEMO");
58 hMemDC
= CreateCompatibleDC (hdc
);
59 hPrevBitmap
= SelectObject (hMemDC
, hBitmap
);
60 GetObjectA (hBitmap
, sizeof(BITMAP
), &bmp
);
61 BitBlt (hdc
, 0, 0, bmp
.bmWidth
, bmp
.bmHeight
,
62 hMemDC
, 0, 0, SRCCOPY
);
63 SelectObject (hMemDC
, hPrevBitmap
);
72 return DefWindowProc (wnd
, msg
, w
, l
);
79 return DefWindowProc (wnd
, msg
, w
, l
);
84 int PASCAL
WinMain (HANDLE inst
, HANDLE prev
, LPSTR cmdline
, int show
)
88 char className
[] = "class"; /* To make sure className >= 0x10000 */
89 char winName
[] = "Test app";
91 Globals
.hInstance
= inst
;
93 class.style
= CS_HREDRAW
| CS_VREDRAW
;
94 class.lpfnWndProc
= WndProc
;
97 class.hInstance
= inst
;
98 class.hIcon
= LoadIcon (0, IDI_APPLICATION
);
99 class.hCursor
= LoadCursor (0, IDC_ARROW
);
100 class.hbrBackground
= GetStockObject (WHITE_BRUSH
);
101 class.lpszMenuName
= 0;
102 class.lpszClassName
= (SEGPTR
)className
;
104 if (!RegisterClass (&class))
107 Globals
.hMainWnd
= CreateWindow (className
, winName
, WS_OVERLAPPEDWINDOW
,
108 CW_USEDEFAULT
, 0, CW_USEDEFAULT
, 0, 0,
109 LoadMenu(inst
,"MAIN"), inst
, 0);
110 ShowWindow (Globals
.hMainWnd
, show
);
111 UpdateWindow (Globals
.hMainWnd
);
113 while (GetMessage (&msg
, 0, 0, 0)){
114 TranslateMessage (&msg
);
115 DispatchMessage (&msg
);