We can use normal imports for shell32 now.
[wine] / programs / control / control.c
1 /* 
2  *   Control
3  *   Copyright (C) 1998 by Marcel Baur <mbaur@g26.ethz.ch>
4  *   To be distributed under the Wine license
5  */
6
7 #include <stdio.h>
8 #include <string.h>
9 #include <windows.h>
10 #include <shellapi.h>
11 #include "params.h"
12
13 void launch(const char *what)
14 {
15   extern void WINAPI Control_RunDLL(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow);
16
17   Control_RunDLL(GetDesktopWindow(), 0, what, SW_SHOW);
18   exit(0);
19 }
20
21 int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, CHAR *szParam, INT argc) 
22 {
23
24   char szParams[255];
25   lstrcpy(szParams, szParam);
26   CharUpper(szParams);
27
28   switch (argc) {
29     case 0:  /* no parameters - pop up whole "Control Panel" by default */
30              launch("");
31              break;
32
33     case 1:  /* check for optional parameter */
34              if (!strcmp(szParams,szP_DESKTOP))
35                  launch(szC_DESKTOP);
36              if (!strcmp(szParams,szP_COLOR))
37                  launch(szC_COLOR);
38              if (!strcmp(szParams,szP_DATETIME))
39                  launch(szC_DATETIME);
40              if (!strcmp(szParams,szP_DESKTOP))
41                  launch(szC_DESKTOP);
42              if (!strcmp(szParams,szP_INTERNATIONAL))
43                  launch(szC_INTERNATIONAL);
44              if (!strcmp(szParams,szP_KEYBOARD))
45                  launch(szC_KEYBOARD);
46              if (!strcmp(szParams,szP_MOUSE))
47                  launch(szC_MOUSE);
48              if (!strcmp(szParams,szP_PORTS))
49                  launch(szC_PORTS);
50              if (!strcmp(szParams,szP_PRINTERS))
51                  launch(szC_PRINTERS);
52
53              /* try to launch if a .cpl file is given directly */
54              launch(szParams);
55              break;
56
57     default: printf("Syntax error.");
58   }
59   return 0;  
60 }