2 * WineCfg main entry point
4 * Copyright 2002 Jaco Greeff
5 * Copyright 2003 Dimitrie O. Paun
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #define NONAMELESSUNION
24 #define NONAMELESSSTRUCT
31 #include "properties.h"
38 PropSheetCallback (HWND hWnd
, UINT uMsg
, LPARAM lParam
)
43 * hWnd = NULL, lParam == dialog resource
48 case PSCB_INITIALIZED
:
57 initGeneralDlg (HWND hDlg
)
60 const VERSION_DESC
*pVer
= NULL
;
62 if ((pVer
= getWinVersions ()))
64 for (i
= 0; *pVer
->szVersion
; i
++, pVer
++)
66 SendDlgItemMessage (hDlg
, IDC_WINVER
, CB_ADDSTRING
,
67 0, (LPARAM
) pVer
->szDescription
);
68 if (!strcmp (pVer
->szVersion
, sCfg
.szWinVer
))
69 SendDlgItemMessage (hDlg
, IDC_WINVER
, CB_SETCURSEL
,
73 if ((pVer
= getDOSVersions ()))
75 for (i
= 0; *pVer
->szVersion
; i
++, pVer
++)
77 SendDlgItemMessage (hDlg
, IDC_DOSVER
, CB_ADDSTRING
,
78 0, (LPARAM
) pVer
->szDescription
);
79 if (!strcmp (pVer
->szVersion
, sCfg
.szDOSVer
))
80 SendDlgItemMessage (hDlg
, IDC_DOSVER
, CB_SETCURSEL
,
84 if ((pVer
= getWinelook ()))
86 for (i
= 0; *pVer
->szVersion
; i
++, pVer
++)
88 SendDlgItemMessage (hDlg
, IDC_WINELOOK
, CB_ADDSTRING
,
89 0, (LPARAM
) pVer
->szDescription
);
90 if (!strcmp (pVer
->szVersion
, sCfg
.szWinLook
))
91 SendDlgItemMessage (hDlg
, IDC_WINELOOK
, CB_SETCURSEL
,
98 GeneralDlgProc (HWND hDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
103 initGeneralDlg (hDlg
);
117 DllDlgProc (HWND hDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
132 AppDlgProc (HWND hDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
146 initX11DrvDlg (HWND hDlg
)
150 sprintf (szBuf
, "%d", sCfg
.sX11Drv
.nSysColors
);
151 SendDlgItemMessage (hDlg
, IDC_SYSCOLORS
, WM_SETTEXT
, 0, (LPARAM
) szBuf
);
152 sprintf (szBuf
, "%d", sCfg
.sX11Drv
.nDesktopSizeX
);
153 SendDlgItemMessage (hDlg
, IDC_DESKTOP_WIDTH
, WM_SETTEXT
, 0,
155 sprintf (szBuf
, "%d", sCfg
.sX11Drv
.nDesktopSizeY
);
156 SendDlgItemMessage (hDlg
, IDC_DESKTOP_HEIGHT
, WM_SETTEXT
, 0,
161 X11DrvDlgProc (HWND hDlg
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
166 initX11DrvDlg (hDlg
);
178 #define NUM_PROPERTY_PAGES 4
180 doPropertySheet (HINSTANCE hInstance
, HWND hOwner
)
182 PROPSHEETPAGE psp
[NUM_PROPERTY_PAGES
];
186 * Fill out the (General) PROPSHEETPAGE data structure
187 * for the property sheet
189 psp
[0].dwSize
= sizeof (PROPSHEETPAGE
);
190 psp
[0].dwFlags
= PSP_USETITLE
;
191 psp
[0].hInstance
= hInstance
;
192 psp
[0].u
.pszTemplate
= MAKEINTRESOURCE (IDD_GENERALCFG
);
193 psp
[0].u2
.pszIcon
= NULL
;
194 psp
[0].pfnDlgProc
= GeneralDlgProc
;
195 psp
[0].pszTitle
= "General";
199 * Fill out the (Libraries) PROPSHEETPAGE data structure
200 * for the property sheet
202 psp
[1].dwSize
= sizeof (PROPSHEETPAGE
);
203 psp
[1].dwFlags
= PSP_USETITLE
;
204 psp
[1].hInstance
= hInstance
;
205 psp
[1].u
.pszTemplate
= MAKEINTRESOURCE (IDD_DLLCFG
);
206 psp
[1].u2
.pszIcon
= NULL
;
207 psp
[1].pfnDlgProc
= DllDlgProc
;
208 psp
[1].pszTitle
= "Libraries";
212 * Fill out the (Applications) PROPSHEETPAGE data structure
213 * for the property sheet
215 psp
[2].dwSize
= sizeof (PROPSHEETPAGE
);
216 psp
[2].dwFlags
= PSP_USETITLE
;
217 psp
[2].hInstance
= hInstance
;
218 psp
[2].u
.pszTemplate
= MAKEINTRESOURCE (IDD_APPCFG
);
219 psp
[2].u2
.pszIcon
= NULL
;
220 psp
[2].pfnDlgProc
= AppDlgProc
;
221 psp
[2].pszTitle
= "Applications";
225 * Fill out the (X11Drv) PROPSHEETPAGE data structure
226 * for the property sheet
228 psp
[3].dwSize
= sizeof (PROPSHEETPAGE
);
229 psp
[3].dwFlags
= PSP_USETITLE
;
230 psp
[3].hInstance
= hInstance
;
231 psp
[3].u
.pszTemplate
= MAKEINTRESOURCE (IDD_X11DRVCFG
);
232 psp
[3].u2
.pszIcon
= NULL
;
233 psp
[3].pfnDlgProc
= X11DrvDlgProc
;
234 psp
[3].pszTitle
= "X11 Driver";
238 * Fill out the PROPSHEETHEADER
240 psh
.dwSize
= sizeof (PROPSHEETHEADER
);
241 psh
.dwFlags
= PSH_PROPSHEETPAGE
| PSH_USEICONID
| PSH_USECALLBACK
;
242 psh
.hwndParent
= hOwner
;
243 psh
.hInstance
= hInstance
;
244 psh
.u
.pszIcon
= NULL
;
245 psh
.pszCaption
= "Wine Configuration";
246 psh
.nPages
= NUM_PROPERTY_PAGES
;
247 psh
.u3
.ppsp
= (LPCPROPSHEETPAGE
) & psp
;
248 psh
.pfnCallback
= (PFNPROPSHEETCALLBACK
) PropSheetCallback
;
251 * Display the modal property sheet
253 return PropertySheet (&psh
);
257 /*****************************************************************************
259 * Description: Main windows entry point
260 * Paramaters : hInstance
264 * Returns : Program exit code
267 WinMain (HINSTANCE hInstance
, HINSTANCE hPrev
, LPSTR szCmdLine
, int nShow
)
270 * Load the configuration from registry
275 * The next 3 lines should be all that is needed
276 * for the Wine Configuration property sheet
278 InitCommonControls ();
279 doPropertySheet (hInstance
, NULL
);