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
26 #define NONAMELESSUNION
27 #define NONAMELESSSTRUCT
33 #include <wine/debug.h>
38 #include "properties.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(winecfg
);
45 PropSheetCallback (HWND hWnd
, UINT uMsg
, LPARAM lParam
)
50 * hWnd = NULL, lParam == dialog resource
55 case PSCB_INITIALIZED
:
64 AboutDlgProc (HWND hDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
69 if (((LPNMHDR
)lParam
)->code
!= PSN_SETACTIVE
) break;
70 /* otherwise fall through, we want to refresh the page as well */
84 #define NUM_PROPERTY_PAGES 6
87 doPropertySheet (HINSTANCE hInstance
, HWND hOwner
)
89 PROPSHEETPAGE psp
[NUM_PROPERTY_PAGES
];
91 int pg
= 0; /* start with page 0 */
94 * Fill out the (Applications) PROPSHEETPAGE data structure
95 * for the property sheet
97 psp
[pg
].dwSize
= sizeof (PROPSHEETPAGE
);
98 psp
[pg
].dwFlags
= PSP_USETITLE
;
99 psp
[pg
].hInstance
= hInstance
;
100 psp
[pg
].u
.pszTemplate
= MAKEINTRESOURCE (IDD_APPCFG
);
101 psp
[pg
].u2
.pszIcon
= NULL
;
102 psp
[pg
].pfnDlgProc
= AppDlgProc
;
103 psp
[pg
].pszTitle
= "Applications";
108 * Fill out the (Libraries) PROPSHEETPAGE data structure
109 * for the property sheet
111 psp
[pg
].dwSize
= sizeof (PROPSHEETPAGE
);
112 psp
[pg
].dwFlags
= PSP_USETITLE
;
113 psp
[pg
].hInstance
= hInstance
;
114 psp
[pg
].u
.pszTemplate
= MAKEINTRESOURCE (IDD_DLLCFG
);
115 psp
[pg
].u2
.pszIcon
= NULL
;
116 psp
[pg
].pfnDlgProc
= LibrariesDlgProc
;
117 psp
[pg
].pszTitle
= "Libraries";
122 * Fill out the (X11Drv) PROPSHEETPAGE data structure
123 * for the property sheet
125 psp
[pg
].dwSize
= sizeof (PROPSHEETPAGE
);
126 psp
[pg
].dwFlags
= PSP_USETITLE
;
127 psp
[pg
].hInstance
= hInstance
;
128 psp
[pg
].u
.pszTemplate
= MAKEINTRESOURCE (IDD_X11DRVCFG
);
129 psp
[pg
].u2
.pszIcon
= NULL
;
130 psp
[pg
].pfnDlgProc
= X11DrvDlgProc
;
131 psp
[pg
].pszTitle
= "X11 Driver";
135 psp
[pg
].dwSize
= sizeof (PROPSHEETPAGE
);
136 psp
[pg
].dwFlags
= PSP_USETITLE
;
137 psp
[pg
].hInstance
= hInstance
;
138 psp
[pg
].u
.pszTemplate
= MAKEINTRESOURCE (IDD_DRIVECFG
);
139 psp
[pg
].u2
.pszIcon
= NULL
;
140 psp
[pg
].pfnDlgProc
= DriveDlgProc
;
141 psp
[pg
].pszTitle
= "Drives";
145 psp
[pg
].dwSize
= sizeof (PROPSHEETPAGE
);
146 psp
[pg
].dwFlags
= PSP_USETITLE
;
147 psp
[pg
].hInstance
= hInstance
;
148 psp
[pg
].u
.pszTemplate
= MAKEINTRESOURCE (IDD_AUDIOCFG
);
149 psp
[pg
].u2
.pszIcon
= NULL
;
150 psp
[pg
].pfnDlgProc
= AudioDlgProc
;
151 psp
[pg
].pszTitle
= "Audio";
156 * Fill out the (General) PROPSHEETPAGE data structure
157 * for the property sheet
159 psp
[pg
].dwSize
= sizeof (PROPSHEETPAGE
);
160 psp
[pg
].dwFlags
= PSP_USETITLE
;
161 psp
[pg
].hInstance
= hInstance
;
162 psp
[pg
].u
.pszTemplate
= MAKEINTRESOURCE (IDD_ABOUTCFG
);
163 psp
[pg
].u2
.pszIcon
= NULL
;
164 psp
[pg
].pfnDlgProc
= AboutDlgProc
;
165 psp
[pg
].pszTitle
= "About";
170 * Fill out the PROPSHEETHEADER
172 psh
.dwSize
= sizeof (PROPSHEETHEADER
);
173 psh
.dwFlags
= PSH_PROPSHEETPAGE
| PSH_USEICONID
| PSH_USECALLBACK
;
174 psh
.hwndParent
= hOwner
;
175 psh
.hInstance
= hInstance
;
176 psh
.u
.pszIcon
= NULL
;
177 psh
.pszCaption
= "Wine Configuration";
178 psh
.nPages
= NUM_PROPERTY_PAGES
;
179 psh
.u3
.ppsp
= (LPCPROPSHEETPAGE
) & psp
;
180 psh
.pfnCallback
= (PFNPROPSHEETCALLBACK
) PropSheetCallback
;
181 psh
.u2
.nStartPage
= 0;
184 * Display the modal property sheet
186 return PropertySheet (&psh
);
190 /*****************************************************************************
192 * Description: Main windows entry point
193 * Parameters : hInstance
197 * Returns : Program exit code
200 WinMain (HINSTANCE hInstance
, HINSTANCE hPrev
, LPSTR szCmdLine
, int nShow
)
203 /* Until winecfg is fully functional, warn users that it is incomplete and doesn't do anything */
204 WINE_FIXME("The winecfg tool is not yet complete, and does not actually alter your configuration.\n");
205 WINE_FIXME("If you want to alter the way Wine works, look in the ~/.wine/config file for more information.\n");
207 if (initialize() != 0) {
208 WINE_ERR("initialization failed, aborting\n");
212 /* is the user running as root? */
214 MessageBox(NULL
, "It is not advisable to run wine as root. Doing so may compromise the security of your computer. Please run wine as a normal user.", "Warning", MB_OK
);
217 * The next 3 lines should be all that is needed
218 * for the Wine Configuration property sheet
220 InitCommonControls ();
221 if (doPropertySheet (hInstance
, NULL
) > 0) {
224 WINE_TRACE("Cancel\n");