Release 981025.
[wine/gsoc-2012-control.git] / programs / control / control.c
blobddee0b1acf08cf359355566cd0795504725c11a0
1 /*
2 * Control
3 * Copyright (C) 1998 by Marcel Baur <mbaur@g26.ethz.ch>
4 * To be distributed under the Wine license
5 */
7 #include <win.h>
8 #include <shell.h>
9 #include "params.h"
11 void launch(char what[255])
13 HINSTANCE hChild;
14 char szArgs[255];
16 lstrcpy(szArgs, szEXEC_ARGS);
17 strcat(szArgs, what);
19 hChild = ShellExecute((HWND)0, 0, szEXEC_PREFIX, szArgs, "", SW_SHOWNORMAL);
20 exit(0);
23 int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, CHAR *szParam, INT argc)
26 char szParams[255];
27 lstrcpy(szParams, szParam);
28 CharUpper(szParams);
30 switch (argc) {
31 case 0: /* no parameters - pop up whole "Control Panel" by default */
32 launch("");
33 break;
35 case 1: /* check for optional parameter */
36 if (strcmp(szParams,szP_DESKTOP) ==0) launch(szC_DESKTOP);
37 if (strcmp(szParams,szP_COLOR) ==0) launch(szC_COLOR);
38 if (strcmp(szParams,szP_DATETIME) ==0) launch(szC_DATETIME);
39 if (strcmp(szParams,szP_DESKTOP) ==0) launch(szC_DESKTOP);
40 if (strcmp(szParams,szP_INTERNATIONAL)==0) launch(szC_INTERNATIONAL);
41 if (strcmp(szParams,szP_KEYBOARD) ==0) launch(szC_KEYBOARD);
42 if (strcmp(szParams,szP_MOUSE) ==0) launch(szC_MOUSE);
43 if (strcmp(szParams,szP_PORTS) ==0) launch(szC_PORTS);
44 if (strcmp(szParams,szP_PRINTERS) ==0) launch(szC_PRINTERS);
46 /* couldn't recognize desired panel, going default mode */
47 launch("");
48 break;
50 default: printf("Syntax error.");
52 return 0;