6 * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
33 ////////////////////////////////////////////////////////////////////////////////
40 TCHAR szTitle
[MAX_LOADSTRING
];
43 ////////////////////////////////////////////////////////////////////////////////
45 // FUNCTION: InitInstance(HANDLE, int)
47 // PURPOSE: creates main window
50 BOOL
InitInstance(HINSTANCE hInstance
, int nCmdShow
)
52 WNDCLASSEX wcFrame
= {
54 CS_HREDRAW
| CS_VREDRAW
/*style*/,
59 LoadIcon(hInstance
, MAKEINTRESOURCE(IDI_ZOOMIN
)),
60 LoadCursor(0, IDC_ARROW
),
61 0,//(HBRUSH)(COLOR_BTNFACE+1),
64 (HICON
)LoadImage(hInstance
, MAKEINTRESOURCE(IDI_ZOOMIN
), IMAGE_ICON
,
65 GetSystemMetrics(SM_CXSMICON
), GetSystemMetrics(SM_CYSMICON
), LR_SHARED
)
67 ATOM hFrameWndClass
= RegisterClassEx(&wcFrame
); // register frame window class
69 hMenuFrame
= LoadMenu(hInstance
, MAKEINTRESOURCE(IDR_ZOOMIN_MENU
));
71 hFrameWnd
= CreateWindowEx(0, (LPCTSTR
)UlongToPtr(hFrameWndClass
), szTitle
,
72 WS_OVERLAPPEDWINDOW
| WS_EX_CLIENTEDGE
| WS_VSCROLL
,
73 CW_USEDEFAULT
, CW_USEDEFAULT
, 250, 250,
74 NULL
, hMenuFrame
, hInstance
, NULL
/*lpParam*/);
80 ShowWindow(hFrameWnd
, nCmdShow
);
81 UpdateWindow(hFrameWnd
);
86 ////////////////////////////////////////////////////////////////////////////////
88 void ExitInstance(void)
90 DestroyMenu(hMenuFrame
);
93 int APIENTRY
WinMain(HINSTANCE hInstance
,
94 HINSTANCE hPrevInstance
,
101 // Initialize global strings
102 LoadString(hInstance
, IDS_APP_TITLE
, szTitle
, MAX_LOADSTRING
);
104 // Perform application initialization:
105 if (!InitInstance(hInstance
, nCmdShow
)) {
109 hAccel
= LoadAccelerators(hInstance
, MAKEINTRESOURCE(IDR_ZOOMIN
));
111 // Main message loop:
112 while (GetMessage(&msg
, (HWND
)NULL
, 0, 0)) {
113 if (!TranslateAccelerator(msg
.hwnd
, hAccel
, &msg
)) {
114 TranslateMessage(&msg
);
115 DispatchMessage(&msg
);