ReactOS  0.4.14-dev-77-gd9e7c48
control.c
Go to the documentation of this file.
1 /* Control Panel management
2  *
3  * Copyright 2001 Eric Pouech
4  * Copyright 2008 Owen Rudge
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * 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 of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #include <assert.h>
22 
23 #define WIN32_NO_STATUS
24 #define _INC_WINDOWS
25 
26 #include <windef.h>
27 #include <winbase.h>
28 #define NO_SHLWAPI_REG
29 #include <shlwapi.h>
30 #include <shellapi.h>
31 #include <wine/debug.h>
32 
33 #include <strsafe.h>
34 
35 #include "cpanel.h"
36 #include "wine/unicode.h"
37 
39 
41 {
42  unsigned i;
43 
44  for (i = 0; i < applet->count; i++)
45  applet->proc(applet->hWnd, CPL_STOP, i, applet->info[i].data);
46 
47  if (applet->proc) applet->proc(applet->hWnd, CPL_EXIT, 0L, 0L);
48  FreeLibrary(applet->hModule);
49 #ifndef __REACTOS__
50  list_remove( &applet->entry );
51 #endif
52  HeapFree(GetProcessHeap(), 0, applet->cmd);
53  HeapFree(GetProcessHeap(), 0, applet);
54 }
55 
57 {
58 #ifdef __REACTOS__
59  ACTCTXW ActCtx = {sizeof(ACTCTX), ACTCTX_FLAG_RESOURCE_NAME_VALID};
60  ULONG_PTR cookie;
61  BOOL bActivated;
62  WCHAR fileBuffer[MAX_PATH];
63 #endif
64  CPlApplet* applet;
65  DWORD len;
66  unsigned i;
67  CPLINFO info;
68  NEWCPLINFOW newinfo;
69 
70  if (!(applet = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*applet))))
71  return applet;
72 
74  if (len > 0)
75  {
76  if (!(applet->cmd = HeapAlloc(GetProcessHeap(), 0, (len+1) * sizeof(WCHAR))))
77  {
78  WARN("Cannot allocate memory for applet path\n");
79  goto theError;
80  }
81  ExpandEnvironmentStringsW(cmd, applet->cmd, len+1);
82  }
83  else
84  {
85  WARN("Cannot expand applet path\n");
86  goto theError;
87  }
88 
89  applet->hWnd = hWnd;
90 
91 #ifdef __REACTOS__
92  StringCchCopy(fileBuffer, MAX_PATH, applet->cmd);
93  if (PathIsFileSpecW(fileBuffer))
94  SearchPath(NULL, fileBuffer, NULL, MAX_PATH, fileBuffer, NULL);
95  ActCtx.lpSource = fileBuffer;
96  ActCtx.lpResourceName = (LPCWSTR)123;
97  applet->hActCtx = CreateActCtx(&ActCtx);
98  bActivated = (applet->hActCtx != INVALID_HANDLE_VALUE ? ActivateActCtx(applet->hActCtx, &cookie) : FALSE);
99 #endif
100 
101  if (!(applet->hModule = LoadLibraryW(applet->cmd))) {
102  WARN("Cannot load control panel applet %s\n", debugstr_w(applet->cmd));
103  goto theError;
104  }
105  if (!(applet->proc = (APPLET_PROC)GetProcAddress(applet->hModule, "CPlApplet"))) {
106  WARN("Not a valid control panel applet %s\n", debugstr_w(applet->cmd));
107  goto theError;
108  }
109  if (!applet->proc(hWnd, CPL_INIT, 0L, 0L)) {
110  WARN("Init of applet has failed\n");
111  goto theError;
112  }
113  if ((applet->count = applet->proc(hWnd, CPL_GETCOUNT, 0L, 0L)) == 0) {
114  WARN("No subprogram in applet\n");
115  applet->proc(applet->hWnd, CPL_EXIT, 0, 0);
116  goto theError;
117  }
118 
119  applet = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, applet,
120  FIELD_OFFSET( CPlApplet, info[applet->count] ));
121 
122  for (i = 0; i < applet->count; i++) {
123  ZeroMemory(&newinfo, sizeof(newinfo));
124  newinfo.dwSize = sizeof(NEWCPLINFOA);
125  applet->info[i].helpfile[0] = 0;
126  /* proc is supposed to return a null value upon success for
127  * CPL_INQUIRE and CPL_NEWINQUIRE
128  * However, real drivers don't seem to behave like this
129  * So, use introspection rather than return value
130  */
131  applet->proc(hWnd, CPL_INQUIRE, i, (LPARAM)&info);
132  applet->info[i].data = info.lData;
133 #ifdef __REACTOS__
134  applet->info[i].idIcon = info.idIcon;
135 #endif
136 
137  if (info.idIcon != CPL_DYNAMIC_RES)
138  applet->info[i].icon = LoadIconW(applet->hModule, MAKEINTRESOURCEW(info.idIcon));
139  if (info.idName != CPL_DYNAMIC_RES)
140  LoadStringW(applet->hModule, info.idName,
141  applet->info[i].name, sizeof(applet->info[i].name) / sizeof(WCHAR));
142  if (info.idInfo != CPL_DYNAMIC_RES)
143  LoadStringW(applet->hModule, info.idInfo,
144  applet->info[i].info, sizeof(applet->info[i].info) / sizeof(WCHAR));
145 
146  /* some broken control panels seem to return incorrect values in CPL_INQUIRE,
147  but proper data in CPL_NEWINQUIRE. if we get an empty string or a null
148  icon, see what we can get from CPL_NEWINQUIRE */
149 
150  if (!applet->info[i].name[0]) info.idName = CPL_DYNAMIC_RES;
151 
152  /* zero-length szInfo may not be a buggy applet, but it doesn't hurt for us
153  to check anyway */
154 
155  if (!applet->info[i].info[0]) info.idInfo = CPL_DYNAMIC_RES;
156 
157  if (applet->info[i].icon == NULL)
158  info.idIcon = CPL_DYNAMIC_RES;
159 
160  if ((info.idIcon == CPL_DYNAMIC_RES) || (info.idName == CPL_DYNAMIC_RES) ||
161  (info.idInfo == CPL_DYNAMIC_RES)) {
162  applet->proc(hWnd, CPL_NEWINQUIRE, i, (LPARAM)&newinfo);
163 
164  applet->info[i].data = newinfo.lData;
165  if (info.idIcon == CPL_DYNAMIC_RES) {
166  if (!newinfo.hIcon) WARN("couldn't get icon for applet %u\n", i);
167  applet->info[i].icon = newinfo.hIcon;
168  }
169  if (newinfo.dwSize == sizeof(NEWCPLINFOW)) {
170  if (info.idName == CPL_DYNAMIC_RES)
171  memcpy(applet->info[i].name, newinfo.szName, sizeof(newinfo.szName));
172  if (info.idInfo == CPL_DYNAMIC_RES)
173  memcpy(applet->info[i].info, newinfo.szInfo, sizeof(newinfo.szInfo));
174  memcpy(applet->info[i].helpfile, newinfo.szHelpFile, sizeof(newinfo.szHelpFile));
175  } else {
176  if (info.idName == CPL_DYNAMIC_RES)
178  sizeof(((LPNEWCPLINFOA)&newinfo)->szName) / sizeof(CHAR),
179  applet->info[i].name, sizeof(applet->info[i].name) / sizeof(WCHAR));
180  if (info.idInfo == CPL_DYNAMIC_RES)
181  MultiByteToWideChar(CP_ACP, 0, ((LPNEWCPLINFOA)&newinfo)->szInfo,
182  sizeof(((LPNEWCPLINFOA)&newinfo)->szInfo) / sizeof(CHAR),
183  applet->info[i].info, sizeof(applet->info[i].info) / sizeof(WCHAR));
185  sizeof(((LPNEWCPLINFOA)&newinfo)->szHelpFile) / sizeof(CHAR),
186  applet->info[i].helpfile,
187  sizeof(applet->info[i].helpfile) / sizeof(WCHAR));
188  }
189  }
190  }
191 
192 #ifdef __REACTOS__
193  if (bActivated)
194  DeactivateActCtx(0, cookie);
195 #endif
196 
197 #ifndef __REACTOS__
198  list_add_head( &panel->applets, &applet->entry );
199 #endif
200 
201  return applet;
202 
203  theError:
204  FreeLibrary(applet->hModule);
205  HeapFree(GetProcessHeap(), 0, applet->cmd);
206  HeapFree(GetProcessHeap(), 0, applet);
207  return NULL;
208 }
209 
210 #ifndef __REACTOS__
211 
212 #define IDC_LISTVIEW 1000
213 #define IDC_STATUSBAR 1001
214 
215 #define NUM_COLUMNS 2
216 #define LISTVIEW_DEFSTYLE (WS_CHILD | WS_VISIBLE | WS_TABSTOP |\
217  LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL)
218 
220 {
221  RECT ws, sb;
222  WCHAR empty_string[] = {0};
224  LVCOLUMNW lvc;
225 
226  /* Create list view */
227  GetClientRect(panel->hWndStatusBar, &sb);
228  GetClientRect(panel->hWnd, &ws);
229 
231  empty_string, LISTVIEW_DEFSTYLE | LVS_ICON,
232  0, 0, ws.right - ws.left, ws.bottom - ws.top -
233  (sb.bottom - sb.top), panel->hWnd,
234  (HMENU) IDC_LISTVIEW, panel->hInst, NULL);
235 
236  if (!panel->hWndListView)
237  return FALSE;
238 
239  /* Create image lists for list view */
244 
247 
248  /* Create columns for list view */
250  lvc.pszText = buf;
251  lvc.fmt = LVCFMT_LEFT;
252 
253  /* Name column */
254  lvc.iSubItem = 0;
255  lvc.cx = (ws.right - ws.left) / 3;
256  LoadStringW(shell32_hInstance, IDS_CPANEL_NAME, buf, sizeof(buf) / sizeof(buf[0]));
257 
258  if (ListView_InsertColumnW(panel->hWndListView, 0, &lvc) == -1)
259  return FALSE;
260 
261  /* Description column */
262  lvc.iSubItem = 1;
263  lvc.cx = ((ws.right - ws.left) / 3) * 2;
264  LoadStringW(shell32_hInstance, IDS_CPANEL_DESCRIPTION, buf, sizeof(buf) /
265  sizeof(buf[0]));
266 
267  if (ListView_InsertColumnW(panel->hWndListView, 1, &lvc) == -1)
268  return FALSE;
269 
270  return(TRUE);
271 }
272 
274 {
275  CPanel* panel = cs->lpCreateParams;
276  HMENU hMenu, hSubMenu;
277  CPlApplet* applet;
278  MENUITEMINFOW mii;
279  unsigned int i;
280  int menucount, index;
281  CPlItem *item;
282  LVITEMW lvItem;
284  INT sb_parts;
285  int itemidx;
286 
287  SetWindowLongPtrW(hWnd, 0, (LONG_PTR)panel);
288  panel->hWnd = hWnd;
289 
290  /* Initialise common control DLL */
291  icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
293  InitCommonControlsEx(&icex);
294 
295  /* create the status bar */
296  if (!(panel->hWndStatusBar = CreateStatusWindowW(WS_CHILD | WS_VISIBLE | CCS_BOTTOM | SBARS_SIZEGRIP, NULL, hWnd, IDC_STATUSBAR)))
297  return;
298 
299  sb_parts = -1;
300  SendMessageW(panel->hWndStatusBar, SB_SETPARTS, 1, (LPARAM) &sb_parts);
301 
302  /* create the list view */
303  if (!Control_CreateListView(panel))
304  return;
305 
306  hMenu = LoadMenuW(shell32_hInstance, MAKEINTRESOURCEW(MENU_CPANEL));
307 
308  /* insert menu items for applets */
309  hSubMenu = GetSubMenu(hMenu, 0);
310  menucount = 0;
311 
312  LIST_FOR_EACH_ENTRY( applet, &panel->applets, CPlApplet, entry )
313  {
314  for (i = 0; i < applet->count; i++) {
315  /* set up a CPlItem for this particular subprogram */
316  item = HeapAlloc(GetProcessHeap(), 0, sizeof(CPlItem));
317 
318  if (!item)
319  continue;
320 
321  item->applet = applet;
322  item->id = i;
323 
324  mii.cbSize = sizeof(MENUITEMINFOW);
326  mii.dwTypeData = applet->info[i].name;
327  mii.cch = sizeof(applet->info[i].name) / sizeof(WCHAR);
328  mii.wID = IDM_CPANEL_APPLET_BASE + menucount;
329  mii.dwItemData = (ULONG_PTR)item;
330 
331  if (InsertMenuItemW(hSubMenu, menucount, TRUE, &mii)) {
332  /* add the list view item */
333  HICON icon = applet->info[i].icon;
334  if (!icon) icon = LoadImageW( 0, (LPCWSTR)IDI_WINLOGO, IMAGE_ICON, 0, 0, LR_SHARED );
335  index = ImageList_AddIcon(panel->hImageListLarge, icon);
336  ImageList_AddIcon(panel->hImageListSmall, icon);
337 
338  lvItem.mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM;
339  lvItem.iItem = menucount;
340  lvItem.iSubItem = 0;
341  lvItem.pszText = applet->info[i].name;
342  lvItem.iImage = index;
343  lvItem.lParam = (LPARAM) item;
344 
345  itemidx = ListView_InsertItemW(panel->hWndListView, &lvItem);
346 
347  /* add the description */
348  ListView_SetItemTextW(panel->hWndListView, itemidx, 1, applet->info[i].info);
349 
350  /* update menu bar, increment count */
351  DrawMenuBar(hWnd);
352  menucount++;
353  }
354  }
355  }
356 
357  panel->total_subprogs = menucount;
358 
359  /* check the "large items" icon in the View menu */
360  hSubMenu = GetSubMenu(hMenu, 1);
363 
364  SetMenu(hWnd, hMenu);
365 }
366 
367 static void Control_FreeCPlItems(HWND hWnd, CPanel *panel)
368 {
369  HMENU hMenu, hSubMenu;
370  MENUITEMINFOW mii;
371  unsigned int i;
372 
373  /* get the File menu */
374  hMenu = GetMenu(hWnd);
375 
376  if (!hMenu)
377  return;
378 
379  hSubMenu = GetSubMenu(hMenu, 0);
380 
381  if (!hSubMenu)
382  return;
383 
384  /* loop and free the item data */
385  for (i = IDM_CPANEL_APPLET_BASE; i <= IDM_CPANEL_APPLET_BASE + panel->total_subprogs; i++)
386  {
387  mii.cbSize = sizeof(MENUITEMINFOW);
388  mii.fMask = MIIM_DATA;
389 
390  if (!GetMenuItemInfoW(hSubMenu, i, FALSE, &mii))
391  continue;
392 
394  }
395 }
396 
398 {
399  HMENU hMenu, hSubMenu;
400 
402 
403  /* update the menu */
404  hMenu = GetMenu(panel->hWnd);
405  hSubMenu = GetSubMenu(hMenu, 1);
406 
408  id, MF_BYCOMMAND);
409 }
410 
412 {
413  HMENU hMenu, hSubMenu;
414  MENUITEMINFOW mii;
415 
416  /* retrieve the CPlItem structure from the menu item data */
417  hMenu = GetMenu(hWnd);
418 
419  if (!hMenu)
420  return NULL;
421 
422  hSubMenu = GetSubMenu(hMenu, 0);
423 
424  if (!hSubMenu)
425  return NULL;
426 
427  mii.cbSize = sizeof(MENUITEMINFOW);
428  mii.fMask = MIIM_DATA;
429 
430  if (!GetMenuItemInfoW(hSubMenu, id, FALSE, &mii))
431  return NULL;
432 
433  return (CPlItem *) mii.dwItemData;
434 }
435 
437 {
438  LVITEMW lvItem;
439  int selitem;
440 
442  | LVNI_SELECTED);
443 
444  if (selitem != -1)
445  {
446  lvItem.iItem = selitem;
447  lvItem.mask = LVIF_PARAM;
448 
449  if (SendMessageW(panel->hWndListView, LVM_GETITEMW, 0, (LPARAM) &lvItem))
450  return (CPlItem *) lvItem.lParam;
451  }
452 
453  return NULL;
454 }
455 
457 {
458  WCHAR verbOpen[] = {'c','p','l','o','p','e','n',0};
459  WCHAR format[] = {'@','%','d',0};
461 
462  /* execute the applet if item is valid */
463  if (item)
464  {
465  wsprintfW(param, format, item->id);
466  ShellExecuteW(hWnd, verbOpen, item->applet->cmd, param, NULL, SW_SHOW);
467  }
468 }
469 
471  WPARAM lParam1, LPARAM lParam2)
472 {
473  CPanel* panel = (CPanel*)GetWindowLongPtrW(hWnd, 0);
474 
475  if (panel || wMsg == WM_CREATE) {
476  switch (wMsg) {
477  case WM_CREATE:
479  return 0;
480  case WM_DESTROY:
481  {
482  CPlApplet *applet, *next;
483  LIST_FOR_EACH_ENTRY_SAFE( applet, next, &panel->applets, CPlApplet, entry )
484  Control_UnloadApplet(applet);
485  }
486  Control_FreeCPlItems(hWnd, panel);
487  PostQuitMessage(0);
488  break;
489  case WM_COMMAND:
490  switch (LOWORD(lParam1))
491  {
492  case IDM_CPANEL_EXIT:
493  SendMessageW(hWnd, WM_CLOSE, 0, 0);
494  return 0;
495 
496  case IDM_CPANEL_ABOUT:
497  {
500  IMAGE_ICON, 48, 48, LR_SHARED);
501 
502  LoadStringW(shell32_hInstance, IDS_CPANEL_TITLE, appName,
503  sizeof(appName) / sizeof(appName[0]));
504  ShellAboutW(hWnd, appName, NULL, icon);
505 
506  return 0;
507  }
508 
511  return 0;
512 
515  return 0;
516 
519  return 0;
520 
523  return 0;
524 
525  default:
526  /* check if this is an applet */
527  if ((LOWORD(lParam1) >= IDM_CPANEL_APPLET_BASE) &&
528  (LOWORD(lParam1) <= IDM_CPANEL_APPLET_BASE + panel->total_subprogs))
529  {
531  return 0;
532  }
533 
534  break;
535  }
536 
537  break;
538 
539  case WM_NOTIFY:
540  {
541  LPNMHDR nmh = (LPNMHDR) lParam2;
542 
543  switch (nmh->idFrom)
544  {
545  case IDC_LISTVIEW:
546  switch (nmh->code)
547  {
548  case NM_RETURN:
549  case NM_DBLCLK:
550  {
552  return 0;
553  }
554  case LVN_ITEMCHANGED:
555  {
557 
558  /* update the status bar if item is valid */
559  if (item)
560  SetWindowTextW(panel->hWndStatusBar, item->applet->info[item->id].info);
561  else
563 
564  return 0;
565  }
566  }
567 
568  break;
569  }
570 
571  break;
572  }
573 
574  case WM_MENUSELECT:
575  /* check if this is an applet */
576  if ((LOWORD(lParam1) >= IDM_CPANEL_APPLET_BASE) &&
577  (LOWORD(lParam1) <= IDM_CPANEL_APPLET_BASE + panel->total_subprogs))
578  {
580 
581  /* update the status bar if item is valid */
582  if (item)
583  SetWindowTextW(panel->hWndStatusBar, item->applet->info[item->id].info);
584  }
585  else if ((HIWORD(lParam1) == 0xFFFF) && (lParam2 == 0))
586  {
587  /* reset status bar description to that of the selected icon */
589 
590  if (item)
591  SetWindowTextW(panel->hWndStatusBar, item->applet->info[item->id].info);
592  else
594 
595  return 0;
596  }
597  else
599 
600  return 0;
601 
602  case WM_SIZE:
603  {
604  HDWP hdwp;
605  RECT sb;
606 
607  hdwp = BeginDeferWindowPos(2);
608 
609  if (hdwp == NULL)
610  break;
611 
612  GetClientRect(panel->hWndStatusBar, &sb);
613 
614  hdwp = DeferWindowPos(hdwp, panel->hWndListView, NULL, 0, 0,
615  LOWORD(lParam2), HIWORD(lParam2) - (sb.bottom - sb.top),
617 
618  if (hdwp == NULL)
619  break;
620 
621  hdwp = DeferWindowPos(hdwp, panel->hWndStatusBar, NULL, 0, 0,
622  LOWORD(lParam2), LOWORD(lParam1), SWP_NOZORDER | SWP_NOMOVE);
623 
624  if (hdwp != NULL)
625  EndDeferWindowPos(hdwp);
626 
627  return 0;
628  }
629  }
630  }
631 
632  return DefWindowProcW(hWnd, wMsg, lParam1, lParam2);
633 }
634 
636 {
637  WNDCLASSEXW wc;
638  MSG msg;
640  const WCHAR className[] = {'S','h','e','l','l','_','C','o','n','t','r','o',
641  'l','_','W','n','d','C','l','a','s','s',0};
642 
643  LoadStringW(shell32_hInstance, IDS_CPANEL_TITLE, appName, sizeof(appName) / sizeof(appName[0]));
644 
645  wc.cbSize = sizeof(wc);
648  wc.cbClsExtra = 0;
649  wc.cbWndExtra = sizeof(CPlApplet*);
650  wc.hInstance = panel->hInst = hInst;
652  wc.hCursor = LoadCursorW( 0, (LPWSTR)IDC_ARROW );
654  wc.lpszMenuName = NULL;
655  wc.lpszClassName = className;
658 
659  if (!RegisterClassExW(&wc)) return;
660 
665  hWnd, NULL, hInst, panel);
666  if (!panel->hWnd) return;
667 
668  while (GetMessageW(&msg, panel->hWnd, 0, 0)) {
671  }
672 }
673 
674 static void Control_RegisterRegistryApplets(HWND hWnd, CPanel *panel, HKEY hkey_root, LPCWSTR szRepPath)
675 {
678  HKEY hkey;
679 
680  if (RegOpenKeyW(hkey_root, szRepPath, &hkey) == ERROR_SUCCESS)
681  {
682  int idx = 0;
683 
684  for(;; ++idx)
685  {
686  DWORD nameLen = MAX_PATH;
687  DWORD valueLen = MAX_PATH;
688 
689  if (RegEnumValueW(hkey, idx, name, &nameLen, NULL, NULL, (LPBYTE)value, &valueLen) != ERROR_SUCCESS)
690  break;
691 
692  Control_LoadApplet(hWnd, value, panel);
693  }
694  RegCloseKey(hkey);
695  }
696 }
697 
699 {
700  HANDLE h;
703  static const WCHAR wszAllCpl[] = {'*','.','c','p','l',0};
704  static const WCHAR wszRegPath[] = {'S','O','F','T','W','A','R','E','\\','M','i','c','r','o','s','o','f','t',
705  '\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n',
706  '\\','C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','C','p','l','s',0};
707  WCHAR *p;
708 
709  /* first add .cpl files in the system directory */
711  p = buffer + strlenW(buffer);
712  *p++ = '\\';
713  lstrcpyW(p, wszAllCpl);
714 
716  do {
717  lstrcpyW(p, fd.cFileName);
718  Control_LoadApplet(hWnd, buffer, panel);
719  } while (FindNextFileW(h, &fd));
720  FindClose(h);
721  }
722 
723  /* now check for cpls in the registry */
726 
727  Control_DoInterface(panel, hWnd, hInst);
728 }
729 
730 #else
731 static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst)
732 {
734  L"open",
735  L"explorer.exe",
736  L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}",
737  NULL,
739 }
740 #endif
741 
742 static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
743  /* forms to parse:
744  * foo.cpl,@sp,str
745  * foo.cpl,@sp
746  * foo.cpl,,str
747  * foo.cpl @sp
748  * foo.cpl str
749  * "a path\foo.cpl"
750  */
751 {
752  LPWSTR buffer;
753  LPWSTR beg = NULL;
754  LPWSTR end;
755  WCHAR ch;
756  LPWSTR ptr;
757  signed sp = -1;
758  LPWSTR extraPmtsBuf = NULL;
759  LPWSTR extraPmts = NULL;
760  BOOL quoted = FALSE;
761  CPlApplet *applet;
762 
763  buffer = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(wszCmd) + 1) * sizeof(*wszCmd));
764  if (!buffer) return;
765 
766  end = lstrcpyW(buffer, wszCmd);
767 
768  for (;;) {
769  ch = *end;
770  if (ch == '"') quoted = !quoted;
771  if (!quoted && (ch == ' ' || ch == ',' || ch == '\0')) {
772  *end = '\0';
773  if (beg) {
774  if (*beg == '@') {
775  sp = atoiW(beg + 1);
776  } else if (*beg == '\0') {
777  sp = -1;
778  } else {
779  extraPmtsBuf = beg;
780  }
781  }
782  if (ch == '\0') break;
783  beg = end + 1;
784  if (ch == ' ') while (end[1] == ' ') end++;
785  }
786  end++;
787  }
788  while ((ptr = StrChrW(buffer, '"')))
789  memmove(ptr, ptr+1, lstrlenW(ptr)*sizeof(WCHAR));
790 
791  /* now check for any quotes in extraPmtsBuf and remove */
792  if (extraPmtsBuf != NULL)
793  {
794  beg = end = extraPmtsBuf;
795  quoted = FALSE;
796 
797  for (;;) {
798  ch = *end;
799  if (ch == '"') quoted = !quoted;
800  if (!quoted && (ch == ' ' || ch == ',' || ch == '\0')) {
801  *end = '\0';
802  if (beg) {
803  if (*beg != '\0') {
804  extraPmts = beg;
805  }
806  }
807  if (ch == '\0') break;
808  beg = end + 1;
809  if (ch == ' ') while (end[1] == ' ') end++;
810  }
811  end++;
812  }
813 
814  while ((ptr = StrChrW(extraPmts, '"')))
815  memmove(ptr, ptr+1, lstrlenW(ptr)*sizeof(WCHAR));
816 
817  if (extraPmts == NULL)
818  extraPmts = extraPmtsBuf;
819  }
820 
821  /* Now check if there had been a numerical value in the extra params */
822  if ((extraPmts) && (*extraPmts == '@') && (sp == -1)) {
823  sp = atoiW(extraPmts + 1);
824  }
825 
826  TRACE("cmd %s, extra %s, sp %d\n", debugstr_w(buffer), debugstr_w(extraPmts), sp);
827 
828  applet = Control_LoadApplet(hWnd, buffer, panel);
829  if (applet)
830  {
831 #ifdef __REACTOS__
832  ULONG_PTR cookie;
833  BOOL bActivated;
834 #endif
835  /* we've been given a textual parameter (or none at all) */
836  if (sp == -1) {
837  while ((++sp) != applet->count) {
838  TRACE("sp %d, name %s\n", sp, debugstr_w(applet->info[sp].name));
839 
840  if (StrCmpIW(extraPmts, applet->info[sp].name) == 0)
841  break;
842  }
843  }
844 
845  if (sp >= applet->count) {
846  WARN("Out of bounds (%u >= %u), setting to 0\n", sp, applet->count);
847  sp = 0;
848  }
849 
850 #ifdef __REACTOS__
851  bActivated = (applet->hActCtx != INVALID_HANDLE_VALUE ? ActivateActCtx(applet->hActCtx, &cookie) : FALSE);
852 #endif
853 
854  if (!applet->proc(applet->hWnd, CPL_STARTWPARMSW, sp, (LPARAM)extraPmts))
855  applet->proc(applet->hWnd, CPL_DBLCLK, sp, applet->info[sp].data);
856 
857  Control_UnloadApplet(applet);
858 
859 #ifdef __REACTOS__
860  if (bActivated)
861  DeactivateActCtx(0, cookie);
862 #endif
863 
864  }
865 
867 }
868 
869 /*************************************************************************
870  * Control_RunDLLW [SHELL32.@]
871  *
872  */
874 {
875  CPanel panel;
876 
877  TRACE("(%p, %p, %s, 0x%08x)\n",
878  hWnd, hInst, debugstr_w(cmd), nCmdShow);
879 
880 #ifndef __REACTOS__
881  memset(&panel, 0, sizeof(panel));
882  list_init( &panel.applets );
883 #endif
884 
885  if (!cmd || !*cmd) {
886  Control_DoWindow(&panel, hWnd, hInst);
887  } else {
888  Control_DoLaunch(&panel, hWnd, cmd);
889  }
890 }
891 
892 /*************************************************************************
893  * Control_RunDLLA [SHELL32.@]
894  *
895  */
897 {
898  DWORD len = MultiByteToWideChar(CP_ACP, 0, cmd, -1, NULL, 0 );
899  LPWSTR wszCmd = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
900  if (wszCmd && MultiByteToWideChar(CP_ACP, 0, cmd, -1, wszCmd, len ))
901  {
902  Control_RunDLLW(hWnd, hInst, wszCmd, nCmdShow);
903  }
904  HeapFree(GetProcessHeap(), 0, wszCmd);
905 }
906 
907 /*************************************************************************
908  * Control_FillCache_RunDLLW [SHELL32.@]
909  *
910  */
912 {
913  FIXME("%p %p 0x%08x 0x%08x stub\n", hWnd, hModule, w, x);
914  return S_OK;
915 }
916 
917 /*************************************************************************
918  * Control_FillCache_RunDLLA [SHELL32.@]
919  *
920  */
922 {
924 }
925 
926 
927 #ifdef __REACTOS__
928 /*************************************************************************
929  * RunDll_CallEntry16 [SHELL32.122]
930  * the name is OK (when written with Dll, and not DLL as in Wine!)
931  */
932 void WINAPI RunDll_CallEntry16( DWORD proc, HWND hwnd, HINSTANCE inst,
933  LPCSTR cmdline, INT cmdshow )
934 {
935  FIXME( "proc %lx hwnd %p inst %p cmdline %s cmdshow %d\n",
936  proc, hwnd, inst, debugstr_a(cmdline), cmdshow );
937 }
938 #endif
939 
940 /*************************************************************************
941  * CallCPLEntry16 [SHELL32.166]
942  *
943  * called by desk.cpl on "Advanced" with:
944  * hMod("DeskCp16.Dll"), pFunc("CplApplet"), 0, 1, 0xc, 0
945  *
946  */
947 DWORD WINAPI CallCPLEntry16(HMODULE hMod, FARPROC pFunc, DWORD dw3, DWORD dw4, DWORD dw5, DWORD dw6)
948 {
949  FIXME("(%p, %p, %08x, %08x, %08x, %08x): stub.\n", hMod, pFunc, dw3, dw4, dw5, dw6);
950  return 0x0deadbee;
951 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
BOOL WINAPI ActivateActCtx(IN HANDLE hActCtx, OUT PULONG_PTR ulCookie)
Definition: actctx.c:237
HWND hWndListView
Definition: cpanel.h:61
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define SW_SHOWDEFAULT
Definition: winuser.h:774
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
BOOL WINAPI TranslateMessage(_In_ const MSG *)
static HICON
Definition: imagelist.c:84
int iImage
Definition: commctrl.h:2339
HDWP WINAPI BeginDeferWindowPos(_In_ int)
#define FCIDM_SHVIEW_LISTVIEW
Definition: shresdef.h:747
#define TRUE
Definition: types.h:120
const char * ws
Definition: skip_ws.cpp:7
struct applet_info info[1]
Definition: cpanel.h:52
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
BOOL WINAPI DrawMenuBar(_In_ HWND)
#define LVCF_WIDTH
Definition: commctrl.h:2559
#define MF_BYCOMMAND
Definition: winuser.h:202
#define LVSIL_SMALL
Definition: commctrl.h:2271
Definition: cpl.h:24
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
int cbWndExtra
Definition: winuser.h:3194
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define LVCF_TEXT
Definition: commctrl.h:2560
HWND hWnd
Definition: cpanel.h:58
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
Definition: ftp_var.h:139
#define IDI_SHELL_CONTROL_PANEL
Definition: shresdef.h:485
superblock * sb
Definition: btrfs.c:4162
HIMAGELIST hImageListSmall
Definition: cpanel.h:63
#define LVS_REPORT
Definition: commctrl.h:2234
#define CP_ACP
Definition: compat.h:99
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
#define HKEY_CURRENT_USER
Definition: winreg.h:11
char CHAR
Definition: xmlstorage.h:175
LONG(APIENTRY * APPLET_PROC)(HWND, UINT, LPARAM, LPARAM)
Definition: cpl.h:23
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define CPL_STOP
Definition: cpl.h:17
#define WARN(fmt,...)
Definition: debug.h:111
#define LVN_ITEMCHANGED
Definition: commctrl.h:3103
struct list entry
Definition: cpanel.h:43
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
#define WC_LISTVIEWW
Definition: commctrl.h:2229
HWND hWnd
Definition: settings.c:17
static void Control_DoInterface(CPanel *panel, HWND hWnd, HINSTANCE hInst)
Definition: control.c:635
#define LVCFMT_LEFT
Definition: commctrl.h:2570
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
#define ZeroMemory
Definition: winbase.h:1635
#define CS_HREDRAW
Definition: winuser.h:648
GLuint buffer
Definition: glext.h:5915
#define SM_CYSMICON
Definition: winuser.h:1003
HICON hIcon
Definition: winuser.h:3196
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
HINSTANCE hInst
Definition: cpanel.h:59
#define WHITE_BRUSH
Definition: wingdi.h:901
#define MAX_STRING_LEN
Definition: precomp.h:36
static int fd
Definition: io.c:51
LPWSTR dwTypeData
Definition: winuser.h:3243
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define LVNI_SELECTED
Definition: commctrl.h:2396
UINT_PTR WPARAM
Definition: windef.h:207
GLuint GLuint end
Definition: gl.h:1545
#define LISTVIEW_DEFSTYLE
Definition: control.c:216
static HANDLE proc()
Definition: pdb.c:32
static void Control_StartApplet(HWND hWnd, CPlItem *item)
Definition: control.c:456
#define WS_CHILD
Definition: pedump.c:617
TCHAR * cmdline
Definition: stretchblt.cpp:32
#define GetWindowLongPtrW
Definition: winuser.h:4730
static void Control_WndProc_Create(HWND hWnd, const CREATESTRUCTW *cs)
Definition: control.c:273
#define SWP_NOZORDER
Definition: winuser.h:1232
#define lstrlenW
Definition: compat.h:407
static void Control_RegisterRegistryApplets(HWND hWnd, CPanel *panel, HKEY hkey_root, LPCWSTR szRepPath)
Definition: control.c:674
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
int32_t INT
Definition: typedefs.h:56
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
struct tagNMHDR * LPNMHDR
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define SearchPath
Definition: winbase.h:3717
struct _test_info info[]
Definition: SetCursorPos.c:19
#define ILC_COLOR32
Definition: commctrl.h:343
#define CPL_DBLCLK
Definition: cpl.h:16
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define LVIF_TEXT
Definition: commctrl.h:2281
#define LVCF_SUBITEM
Definition: commctrl.h:2561
UINT code
Definition: winuser.h:3133
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
HRESULT WINAPI Control_FillCache_RunDLLA(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)
Definition: control.c:921
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
uint32_t cs
Definition: isohybrid.c:75
BOOL WINAPI DeactivateActCtx(IN DWORD dwFlags, IN ULONG_PTR ulCookie)
Definition: actctx.c:268
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
APPLET_PROC proc
Definition: cpanel.h:51
LPCWSTR lpszMenuName
Definition: winuser.h:3199
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
unsigned char * LPBYTE
Definition: typedefs.h:52
HWND hWndStatusBar
Definition: cpanel.h:64
HINSTANCE shell32_hInstance
Definition: misc.cpp:82
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
unsigned int BOOL
Definition: ntddk_ex.h:94
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
static void Control_FreeCPlItems(HWND hWnd, CPanel *panel)
Definition: control.c:367
#define CPL_DYNAMIC_RES
Definition: cpl.h:11
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
UINT_PTR idFrom
Definition: winuser.h:3132
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3296
int iSubItem
Definition: commctrl.h:2334
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
#define debugstr_w
Definition: kernel32.h:32
VOID WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
Definition: control.c:873
HWND WINAPI CreateStatusWindowW(LONG style, LPCWSTR text, HWND parent, UINT wid)
Definition: commctrl.c:795
LPARAM lParam
Definition: commctrl.h:2340
#define WM_MENUSELECT
Definition: winuser.h:1729
#define FIXME(fmt,...)
Definition: debug.h:110
static PVOID ptr
Definition: dispmode.c:27
#define SM_CXICON
Definition: winuser.h:962
unsigned int idx
Definition: utils.c:41
#define CPL_NEWINQUIRE
Definition: cpl.h:19
#define CW_USEDEFAULT
Definition: winuser.h:225
BOOL WINAPI PathIsFileSpecW(LPCWSTR lpszPath)
Definition: path.c:2112
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2853
HRESULT WINAPI Control_FillCache_RunDLLW(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)
Definition: control.c:911
#define IDC_STATUSBAR
Definition: control.c:213
#define LoadLibraryW(x)
Definition: compat.h:404
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
static BOOL Control_CreateListView(CPanel *panel)
Definition: control.c:219
int cbClsExtra
Definition: winuser.h:3193
#define LVNI_FOCUSED
Definition: commctrl.h:2395
GLuint index
Definition: glext.h:6031
#define LVS_LIST
Definition: commctrl.h:2236
const char * LPCSTR
Definition: xmlstorage.h:183
#define SW_SHOW
Definition: winuser.h:769
LPCWSTR lpszClassName
Definition: winuser.h:3200
#define WM_DESTROY
Definition: winuser.h:1591
#define MIIM_ID
Definition: winuser.h:717
#define CCS_BOTTOM
Definition: commctrl.h:2216
#define CS_VREDRAW
Definition: winuser.h:653
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:405
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CPL_EXIT
Definition: cpl.h:18
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define SBARS_SIZEGRIP
Definition: commctrl.h:1895
#define WM_SIZE
Definition: winuser.h:1593
#define debugstr_a
Definition: kernel32.h:31
LPWSTR cmd
Definition: cpanel.h:48
HBRUSH hbrBackground
Definition: winuser.h:3198
LONG HRESULT
Definition: typedefs.h:77
BOOL WINAPI SetMenu(_In_ HWND, _In_opt_ HMENU)
UINT cbSize
Definition: winuser.h:3190
#define FCIDM_SHVIEW_REPORTVIEW
Definition: shresdef.h:748
LPWSTR pszText
Definition: commctrl.h:2337
#define WM_CLOSE
Definition: winuser.h:1603
GLfloat param
Definition: glext.h:5796
#define MAX_PATH
Definition: compat.h:26
#define WINAPI
Definition: msvc.h:8
#define LVIF_IMAGE
Definition: commctrl.h:2282
unsigned count
Definition: cpanel.h:49
#define IDI_WINLOGO
Definition: winuser.h:704
LPWSTR pszText
Definition: commctrl.h:2539
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
DWORD dwSize
Definition: cpl.h:41
void Control_UnloadApplet(CPlApplet *applet)
Definition: control.c:40
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:540
_In_ PCWSTR _Out_ PVOID * ActCtx
Definition: ldrtypes.h:247
#define CPL_STARTWPARMSW
Definition: cpl.h:21
#define CPL_INIT
Definition: cpl.h:12
HINSTANCE hInstance
Definition: winuser.h:3195
WINE_DEFAULT_DEBUG_CHANNEL(shlctrl)
#define LVS_ICON
Definition: commctrl.h:2233
UINT mask
Definition: commctrl.h:2332
#define SM_CXSMICON
Definition: winuser.h:1002
static CPlItem * Control_GetCPlItem_From_ListView(CPanel *panel)
Definition: control.c:436
#define SM_CYICON
Definition: winuser.h:963
TCHAR szHelpFile[]
Definition: scrnsave.c:30
#define index(s, c)
Definition: various.h:29
#define CPL_INQUIRE
Definition: cpl.h:14
static const WCHAR L[]
Definition: oid.c:1250
#define StringCchCopy
Definition: strsafe.h:139
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
static void Control_DoLaunch(CPanel *panel, HWND hWnd, LPCWSTR wszCmd)
Definition: control.c:742
struct tagNEWCPLINFOA NEWCPLINFOA
uint32_t entry
Definition: isohybrid.c:63
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
#define ILC_MASK
Definition: commctrl.h:336
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
HCURSOR hCursor
Definition: winuser.h:3197
#define LVSIL_NORMAL
Definition: commctrl.h:2270
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
Definition: cpanel.h:68
#define WM_COMMAND
Definition: winuser.h:1722
UINT style
Definition: winuser.h:3191
struct list applets
Definition: cpanel.h:57
#define FCIDM_SHVIEW_BIGICON
Definition: shresdef.h:745
WNDPROC lpfnWndProc
Definition: winuser.h:3192
Definition: cpanel.h:56
static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg, WPARAM lParam1, LPARAM lParam2)
Definition: control.c:470
#define GWL_STYLE
Definition: winuser.h:846
HWND hWnd
Definition: cpanel.h:47
#define NM_RETURN
Definition: commctrl.h:132
#define LVM_SETIMAGELIST
Definition: commctrl.h:2275
#define MIIM_STRING
Definition: winuser.h:722
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define LVCF_FMT
Definition: commctrl.h:2558
#define S_OK
Definition: intsafe.h:59
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58
HINSTANCE hInst
Definition: dxdiag.c:13
DWORD WINAPI CallCPLEntry16(HMODULE hMod, FARPROC pFunc, DWORD dw3, DWORD dw4, DWORD dw5, DWORD dw6)
Definition: control.c:947
static unsigned __int64 next
Definition: rand_nt.c:6
static void Control_UpdateListViewStyle(CPanel *panel, UINT style, UINT id)
Definition: control.c:397
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
static ATOM item
Definition: dde.c:856
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define lstrcpyW
Definition: compat.h:406
#define NM_DBLCLK
Definition: commctrl.h:131
unsigned total_subprogs
Definition: cpanel.h:60
static CPlItem * Control_GetCPlItem_From_MenuID(HWND hWnd, UINT id)
Definition: control.c:411
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HeapReAlloc
Definition: compat.h:393
HIMAGELIST hImageListLarge
Definition: cpanel.h:62
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2312
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
Definition: string.c:468
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
unsigned int UINT
Definition: ndis.h:50
CPlApplet * Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel *panel)
Definition: control.c:56
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define SB_SETPARTS
Definition: commctrl.h:1926
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define IDC_LISTVIEW
Definition: control.c:212
static void Control_DoWindow(CPanel *panel, HWND hWnd, HINSTANCE hInst)
Definition: control.c:698
#define MultiByteToWideChar
Definition: compat.h:100
HICON hIconSm
Definition: winuser.h:3201
HMODULE hModule
Definition: cpanel.h:50
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
Definition: name.c:36
static const WCHAR szName[]
Definition: msipriv.h:1194
#define LVM_GETITEMW
Definition: commctrl.h:2362
#define LVIF_PARAM
Definition: commctrl.h:2283
#define WM_CREATE
Definition: winuser.h:1590
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2208
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define HIWORD(l)
Definition: typedefs.h:246
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
const char * appName(const char *argv0)
Definition: loadlib.c:89
#define ULONG_PTR
Definition: config.h:101
static const WCHAR sp[]
Definition: suminfo.c:288
#define GetProcAddress(x, y)
Definition: compat.h:410
#define SWP_NOMOVE
Definition: winuser.h:1229
#define SetWindowLongPtrW
Definition: winuser.h:5247
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define MIIM_DATA
Definition: winuser.h:721
LONG_PTR LRESULT
Definition: windef.h:209
#define LVM_GETNEXTITEM
Definition: commctrl.h:2405
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
#define memset(x, y, z)
Definition: compat.h:39
HMENU WINAPI GetMenu(_In_ HWND)
#define ListView_InsertItemW(hwnd, pitem)
Definition: commctrl.h:38
ULONG_PTR dwItemData
Definition: winuser.h:3242
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define FCIDM_SHVIEW_SMALLICON
Definition: shresdef.h:746
#define LOWORD(l)
Definition: pedump.c:82
struct tagMENUITEMINFOW MENUITEMINFOW
#define HeapFree(x, y, z)
Definition: compat.h:394
#define CPL_GETCOUNT
Definition: cpl.h:13
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
int WINAPI StrCmpIW(LPCWSTR lpszStr, LPCWSTR lpszComp)
Definition: string.c:353
int(* FARPROC)()
Definition: compat.h:28
#define WM_NOTIFY
Definition: richedit.h:61
#define LVS_SMALLICON
Definition: commctrl.h:2235
WINE_UNICODE_INLINE int atoiW(const WCHAR *str)
Definition: unicode.h:315
HMODULE hModule
Definition: animate.c:44
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
void WINAPI Control_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow)
Definition: control.c:896
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502