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.
26 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
43 //#include <winspool.h>
46 ////////////////////////////////////////////////////////////////////////////////
52 TCHAR szTitle
[MAX_LOADSTRING
];
53 TCHAR szFrameClass
[MAX_LOADSTRING
];
54 //TCHAR szWindowClass[MAX_LOADSTRING];
57 ////////////////////////////////////////////////////////////////////////////////
60 // FUNCTION: InitInstance(HANDLE, int)
62 // PURPOSE: Saves instance handle and creates main window
66 // In this function, we save the instance handle in a global variable and
67 // create and display the main program window.
69 BOOL
InitInstance(HINSTANCE hInstance
, int nCmdShow
)
74 wcex
.cbSize
= sizeof(WNDCLASSEX
);
75 wcex
.style
= CS_HREDRAW
| CS_VREDRAW
;
76 wcex
.lpfnWndProc
= (WNDPROC
)FrameWndProc
;
79 wcex
.hInstance
= hInstance
;
80 wcex
.hIcon
= LoadIcon(hInstance
, (LPCTSTR
)IDI_REGEDIT
);
81 wcex
.hCursor
= LoadCursor(NULL
, IDC_ARROW
);
82 wcex
.hbrBackground
= (HBRUSH
)SS_BLACKRECT
/*(COLOR_WINDOW+1)*/;
83 // wcex.lpszMenuName = (LPCSTR)IDC_REGEDIT;
84 wcex
.lpszMenuName
= (LPCSTR
)IDR_REGEDIT_MENU
;
85 wcex
.lpszClassName
= szFrameClass
;
86 wcex
.hIconSm
= LoadIcon((HINSTANCE
)wcex
.hInstance
, (LPCTSTR
)IDI_SMALL
);
87 RegisterClassEx(&wcex
);
89 // Initialize the Windows Common Controls DLL
92 hInst
= hInstance
; // Store instance handle in our global variable
93 hMainWnd
= CreateWindow(szFrameClass
, szTitle
, WS_OVERLAPPEDWINDOW
,
94 CW_USEDEFAULT
, 0, CW_USEDEFAULT
, 0, NULL
, NULL
, hInstance
, NULL
);
99 // Get the minimum window sizes
100 // GetWindowRect(hMainWnd, &rc);
101 // nMinimumWidth = (rc.right - rc.left);
102 // nMinimumHeight = (rc.bottom - rc.top);
104 // Create the status bar
105 hStatusBar
= CreateStatusWindow(WS_VISIBLE
|WS_CHILD
|WS_CLIPSIBLINGS
|SBT_NOBORDERS
,
106 _T(""), hMainWnd
, STATUS_WINDOW
);
110 // Create the status bar panes
114 SendMessage(hStatusBar
, SB_SETPARTS
, 3, (long)nParts
);
117 hSplitWnd = CreateWindow(szFrameClass, "splitter window", WS_VISIBLE|WS_CHILD,
118 CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
119 hMainWnd, (HMENU)SPLIT_WINDOW, hInstance, NULL);
123 ShowWindow(hMainWnd
, nCmdShow
);
124 UpdateWindow(hMainWnd
);
128 ////////////////////////////////////////////////////////////////////////////////
130 void ExitInstance(void)
132 // DestroyMenu(hMenuFrame);
136 int APIENTRY
WinMain(HINSTANCE hInstance
,
137 HINSTANCE hPrevInstance
,
144 // Initialize global strings
145 LoadString(hInstance
, IDS_APP_TITLE
, szTitle
, MAX_LOADSTRING
);
146 LoadString(hInstance
, IDC_REGEDIT_FRAME
, szFrameClass
, MAX_LOADSTRING
);
147 // LoadString(hInstance, IDC_REGEDIT, szWindowClass, MAX_LOADSTRING);
149 // Store instance handle in our global variable
152 // Perform application initialization:
153 if (!InitInstance(hInstance
, nCmdShow
)) {
156 hAccel
= LoadAccelerators(hInstance
, (LPCTSTR
)IDC_REGEDIT
);
158 // Main message loop:
159 while (GetMessage(&msg
, (HWND
)NULL
, 0, 0)) {
160 if (!TranslateAccelerator(msg
.hwnd
, hAccel
, &msg
)) {
161 TranslateMessage(&msg
);
162 DispatchMessage(&msg
);