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
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
);
38 int WINAPI
wWinMain(HINSTANCE hInst
, HINSTANCE hPrev
, LPWSTR lpszCmdLine
, INT nCmdShow
)
40 /* no parameters - pop up whole "Control Panel" by default */
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"))
52 if (!lstrcmpiW(lpszCmdLine
, L
"INTERNATIONAL"))
54 if (!lstrcmpiW(lpszCmdLine
, L
"KEYBOARD"))
55 launch(L
"main.cpl @1");
56 if (!lstrcmpiW(lpszCmdLine
, L
"MOUSE"))
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 */