server: Allow polling on an fd after it was removed.
[wine.git] / programs / control / control.c
blobb72416893c938a8f1f820701d6743c8f6f1adf55
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 <shellapi.h>
30 extern void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow);
32 static void launch(LPCWSTR what)
34 Control_RunDLLW(GetDesktopWindow(), 0, what, SW_SHOW);
35 ExitProcess(0);
38 int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR lpszCmdLine, INT nCmdShow)
40 /* no parameters - pop up whole "Control Panel" by default */
41 if (!*lpszCmdLine) {
42 launch(lpszCmdLine);
45 /* check for optional parameter */
46 if (!lstrcmpiW(lpszCmdLine, L"COLOR"))
47 launch(L"desk.cpl,,2");
48 if (!lstrcmpiW(lpszCmdLine, L"DATE/TIME"))
49 launch(L"timedate.cpl");
50 if (!lstrcmpiW(lpszCmdLine, L"DESKTOP"))
51 launch(L"desk.cpl");
52 if (!lstrcmpiW(lpszCmdLine, L"INTERNATIONAL"))
53 launch(L"intl.cpl");
54 if (!lstrcmpiW(lpszCmdLine, L"KEYBOARD"))
55 launch(L"main.cpl @1");
56 if (!lstrcmpiW(lpszCmdLine, L"MOUSE"))
57 launch(L"main.cpl");
58 if (!lstrcmpiW(lpszCmdLine, L"PORTS"))
59 launch(L"sysdm.cpl,,1");
60 if (!lstrcmpiW(lpszCmdLine, L"PRINTERS"))
61 launch(L"main.cpl @2");
63 /* try to launch if a .cpl file is given directly */
64 launch(lpszCmdLine);
65 return 0;