Put the .spec.o file first and the so libraries last on the link
[wine.git] / programs / winecfg / main.c
blob7222b443e1cc82f2242c999c46a4ee8954a7fbeb
1 /*
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
27 #include <windows.h>
28 #include <commctrl.h>
29 #include <stdlib.h>
30 #include <stdio.h>
31 #include <wine/debug.h>
33 #include "properties.h"
34 #include "resource.h"
35 #include "winecfg.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(winecfg);
39 void CALLBACK
40 PropSheetCallback (HWND hWnd, UINT uMsg, LPARAM lParam)
42 switch (uMsg)
45 * hWnd = NULL, lParam == dialog resource
47 case PSCB_PRECREATE:
48 break;
50 case PSCB_INITIALIZED:
51 break;
53 default:
54 break;
58 INT_PTR CALLBACK
59 AboutDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
61 switch (uMsg) {
63 case WM_NOTIFY:
64 if (((LPNMHDR)lParam)->code != PSN_SETACTIVE) break;
65 /* otherwise fall through, we want to refresh the page as well */
66 case WM_INITDIALOG:
67 break;
69 case WM_COMMAND:
70 break;
72 default:
73 break;
76 return FALSE;
79 #define NUM_PROPERTY_PAGES 6
81 INT_PTR
82 doPropertySheet (HINSTANCE hInstance, HWND hOwner)
84 PROPSHEETPAGE psp[NUM_PROPERTY_PAGES];
85 PROPSHEETHEADER psh;
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";
99 psp[pg].lParam = 0;
100 pg++;
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";
113 psp[pg].lParam = 0;
114 pg++;
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";
127 psp[pg].lParam = 0;
128 pg++;
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";
137 psp[pg].lParam = 0;
138 pg++;
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";
147 psp[pg].lParam = 0;
148 pg++;
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";
161 psp[pg].lParam = 0;
162 pg++;
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 /*****************************************************************************
186 * Name : WinMain
187 * Description: Main windows entry point
188 * Parameters : hInstance
189 * hPrev
190 * szCmdLine
191 * nShow
192 * Returns : Program exit code
194 int WINAPI
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");
204 ExitProcess(1);
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) {
213 WINE_TRACE("OK\n");
214 } else {
215 WINE_TRACE("Cancel\n");
218 ExitProcess (0);
220 return 0;