wineoss: Fix missing break statement.
[wine.git] / programs / control / control.c
blob507abcc1cce26fbdfd8fbf950c027092cbd97002
1 /*
2 * Start a control panel applet or open the control panel window
4 * Copyright (C) 1998 by Marcel Baur <mbaur@g26.ethz.ch>
5 * Copyright 2010 Detlef Riekenberg
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #define WIN32_LEAN_AND_MEAN
24 #include <stdio.h>
25 #include <string.h>
26 #include <windows.h>
27 #include <commctrl.h>
28 #include <shellapi.h>
31 extern void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow);
33 static void launch(LPCWSTR what)
35 Control_RunDLLW(GetDesktopWindow(), 0, what, SW_SHOW);
36 ExitProcess(0);
39 int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR lpszCmdLine, INT nCmdShow)
41 InitCommonControls();
43 /* no parameters - pop up whole "Control Panel" by default */
44 if (!*lpszCmdLine) {
45 launch(lpszCmdLine);
48 /* check for optional parameter */
49 if (!lstrcmpiW(lpszCmdLine, L"COLOR"))
50 launch(L"desk.cpl,,2");
51 if (!lstrcmpiW(lpszCmdLine, L"DATE/TIME"))
52 launch(L"timedate.cpl");
53 if (!lstrcmpiW(lpszCmdLine, L"DESKTOP"))
54 launch(L"desk.cpl");
55 if (!lstrcmpiW(lpszCmdLine, L"INTERNATIONAL"))
56 launch(L"intl.cpl");
57 if (!lstrcmpiW(lpszCmdLine, L"KEYBOARD"))
58 launch(L"main.cpl @1");
59 if (!lstrcmpiW(lpszCmdLine, L"MOUSE"))
60 launch(L"main.cpl");
61 if (!lstrcmpiW(lpszCmdLine, L"PORTS"))
62 launch(L"sysdm.cpl,,1");
63 if (!lstrcmpiW(lpszCmdLine, L"PRINTERS"))
64 launch(L"main.cpl @2");
66 /* try to launch if a .cpl file is given directly */
67 launch(lpszCmdLine);
68 return 0;