2 * WineCfg main entry point
4 * Copyright 2002 Jaco Greeff
5 * Copyright 2003 Dimitrie O. Paun
6 * Copyright 2003 Mike Hearn
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library 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 GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #define NONAMELESSUNION
25 #define NONAMELESSSTRUCT
31 #include <wine/debug.h>
33 #include "properties.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(winecfg);
40 PropSheetCallback (HWND hWnd, UINT uMsg, LPARAM lParam)
45 * hWnd = NULL, lParam == dialog resource
50 case PSCB_INITIALIZED:
59 AboutDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
64 if (((LPNMHDR)lParam)->code != PSN_SETACTIVE) break;
65 /* otherwise fall through, we want to refresh the page as well */
79 #define NUM_PROPERTY_PAGES 6
82 doPropertySheet (HINSTANCE hInstance, HWND hOwner)
84 PROPSHEETPAGE psp[NUM_PROPERTY_PAGES];
86 int pg = 0; /* start with page 0 */
89 * Fill out the (Applications) PROPSHEETPAGE data structure
90 * for the property sheet
92 psp[pg].dwSize = sizeof (PROPSHEETPAGE);
93 psp[pg].dwFlags = PSP_USETITLE;
94 psp[pg].hInstance = hInstance;
95 psp[pg].u.pszTemplate = MAKEINTRESOURCE (IDD_APPCFG);
96 psp[pg].u2.pszIcon = NULL;
97 psp[pg].pfnDlgProc = AppDlgProc;
98 psp[pg].pszTitle = "Applications";
103 * Fill out the (Libraries) PROPSHEETPAGE data structure
104 * for the property sheet
106 psp[pg].dwSize = sizeof (PROPSHEETPAGE);
107 psp[pg].dwFlags = PSP_USETITLE;
108 psp[pg].hInstance = hInstance;
109 psp[pg].u.pszTemplate = MAKEINTRESOURCE (IDD_DLLCFG);
110 psp[pg].u2.pszIcon = NULL;
111 psp[pg].pfnDlgProc = LibrariesDlgProc;
112 psp[pg].pszTitle = "Libraries";
117 * Fill out the (X11Drv) PROPSHEETPAGE data structure
118 * for the property sheet
120 psp[pg].dwSize = sizeof (PROPSHEETPAGE);
121 psp[pg].dwFlags = PSP_USETITLE;
122 psp[pg].hInstance = hInstance;
123 psp[pg].u.pszTemplate = MAKEINTRESOURCE (IDD_X11DRVCFG);
124 psp[pg].u2.pszIcon = NULL;
125 psp[pg].pfnDlgProc = X11DrvDlgProc;
126 psp[pg].pszTitle = "X11 Driver";
130 psp[pg].dwSize = sizeof (PROPSHEETPAGE);
131 psp[pg].dwFlags = PSP_USETITLE;
132 psp[pg].hInstance = hInstance;
133 psp[pg].u.pszTemplate = MAKEINTRESOURCE (IDD_DRIVECFG);
134 psp[pg].u2.pszIcon = NULL;
135 psp[pg].pfnDlgProc = DriveDlgProc;
136 psp[pg].pszTitle = "Drives";
140 psp[pg].dwSize = sizeof (PROPSHEETPAGE);
141 psp[pg].dwFlags = PSP_USETITLE;
142 psp[pg].hInstance = hInstance;
143 psp[pg].u.pszTemplate = MAKEINTRESOURCE (IDD_AUDIOCFG);
144 psp[pg].u2.pszIcon = NULL;
145 psp[pg].pfnDlgProc = AudioDlgProc;
146 psp[pg].pszTitle = "Audio";
151 * Fill out the (General) PROPSHEETPAGE data structure
152 * for the property sheet
154 psp[pg].dwSize = sizeof (PROPSHEETPAGE);
155 psp[pg].dwFlags = PSP_USETITLE;
156 psp[pg].hInstance = hInstance;
157 psp[pg].u.pszTemplate = MAKEINTRESOURCE (IDD_ABOUTCFG);
158 psp[pg].u2.pszIcon = NULL;
159 psp[pg].pfnDlgProc = AboutDlgProc;
160 psp[pg].pszTitle = "About";
165 * Fill out the PROPSHEETHEADER
167 psh.dwSize = sizeof (PROPSHEETHEADER);
168 psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK;
169 psh.hwndParent = hOwner;
170 psh.hInstance = hInstance;
171 psh.u.pszIcon = NULL;
172 psh.pszCaption = "Wine Configuration";
173 psh.nPages = NUM_PROPERTY_PAGES;
174 psh.u3.ppsp = (LPCPROPSHEETPAGE) & psp;
175 psh.pfnCallback = (PFNPROPSHEETCALLBACK) PropSheetCallback;
176 psh.u2.nStartPage = 0;
179 * Display the modal property sheet
181 return PropertySheet (&psh);
185 /*****************************************************************************
187 * Description: Main windows entry point
188 * Parameters : hInstance
192 * Returns : Program exit code
195 WinMain (HINSTANCE hInstance, HINSTANCE hPrev, LPSTR szCmdLine, int nShow)
198 /* Until winecfg is fully functional, warn users that it is incomplete and doesn't do anything */
199 WINE_FIXME("The winecfg tool is not yet complete, and does not actually alter your configuration.\n");
200 WINE_FIXME("If you want to alter the way Wine works, look in the ~/.wine/config file for more information.\n");
202 if (initialize() != 0) {
203 WINE_ERR("initialization failed, aborting\n");
208 * The next 3 lines should be all that is needed
209 * for the Wine Configuration property sheet
211 InitCommonControls ();
212 if (doPropertySheet (hInstance, NULL) > 0) {
215 WINE_TRACE("Cancel\n");