/*1* Start a control panel applet or open the control panel window2*3* Copyright (C) 1998 by Marcel Baur <[email protected]>4* Copyright 2010 Detlef Riekenberg5*6* This library is free software; you can redistribute it and/or7* modify it under the terms of the GNU Lesser General Public8* License as published by the Free Software Foundation; either9* version 2.1 of the License, or (at your option) any later version.10*11* This library is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU14* Lesser General Public License for more details.15*16* You should have received a copy of the GNU Lesser General Public17* License along with this library; if not, write to the Free Software18* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA19*/2021#define WIN32_LEAN_AND_MEAN2223#include <stdio.h>24#include <string.h>25#include <windows.h>26#include <commctrl.h>27#include <shellapi.h>282930extern void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow);3132static void launch(LPCWSTR what)33{34Control_RunDLLW(GetDesktopWindow(), 0, what, SW_SHOW);35ExitProcess(0);36}3738int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR lpszCmdLine, INT nCmdShow)39{40InitCommonControls();4142/* no parameters - pop up whole "Control Panel" by default */43if (!*lpszCmdLine) {44launch(lpszCmdLine);45}4647/* check for optional parameter */48if (!lstrcmpiW(lpszCmdLine, L"COLOR"))49launch(L"desk.cpl,,2");50if (!lstrcmpiW(lpszCmdLine, L"DATE/TIME"))51launch(L"timedate.cpl");52if (!lstrcmpiW(lpszCmdLine, L"DESKTOP"))53launch(L"desk.cpl");54if (!lstrcmpiW(lpszCmdLine, L"INTERNATIONAL"))55launch(L"intl.cpl");56if (!lstrcmpiW(lpszCmdLine, L"KEYBOARD"))57launch(L"main.cpl @1");58if (!lstrcmpiW(lpszCmdLine, L"MOUSE"))59launch(L"main.cpl");60if (!lstrcmpiW(lpszCmdLine, L"PORTS"))61launch(L"sysdm.cpl,,1");62if (!lstrcmpiW(lpszCmdLine, L"PRINTERS"))63launch(L"main.cpl @2");6465/* try to launch if a .cpl file is given directly */66launch(lpszCmdLine);67return 0;68}697071