ReactOS 0.4.15-dev-7924-g5949c20
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 * Copyright 2022 Raymond Czerny
6 *
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.
11 *
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.
16 *
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
20 */
21
22#include <assert.h>
23
24#define WIN32_NO_STATUS
25#define _INC_WINDOWS
26
27#include <windef.h>
28#include <winbase.h>
29#define NO_SHLWAPI_REG
30#include <shlwapi.h>
31#include <shellapi.h>
32#define COBJMACROS
33#include <shlobj.h>
34#include <shobjidl.h>
35#include <wine/debug.h>
36#include <wine/unicode.h>
37
38#include <strsafe.h>
39
40#include "cpanel.h"
41#include "shell32_main.h"
42
44
46{
47 unsigned i;
48
49 for (i = 0; i < applet->count; i++)
50 applet->proc(applet->hWnd, CPL_STOP, i, applet->info[i].data);
51
52 if (applet->proc) applet->proc(applet->hWnd, CPL_EXIT, 0L, 0L);
53 FreeLibrary(applet->hModule);
54#ifndef __REACTOS__
55 list_remove( &applet->entry );
56#endif
57 HeapFree(GetProcessHeap(), 0, applet->cmd);
58 HeapFree(GetProcessHeap(), 0, applet);
59}
60
62{
63#ifdef __REACTOS__
64 ACTCTXW ActCtx = {sizeof(ACTCTX), ACTCTX_FLAG_RESOURCE_NAME_VALID};
66 BOOL bActivated;
67 WCHAR fileBuffer[MAX_PATH];
68#endif
69 CPlApplet* applet;
70 DWORD len;
71 unsigned i;
73 NEWCPLINFOW newinfo;
74
75 if (!(applet = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*applet))))
76 return applet;
77
79 if (len > 0)
80 {
81 if (!(applet->cmd = HeapAlloc(GetProcessHeap(), 0, (len+1) * sizeof(WCHAR))))
82 {
83 WARN("Cannot allocate memory for applet path\n");
84 goto theError;
85 }
87 }
88 else
89 {
90 WARN("Cannot expand applet path\n");
91 goto theError;
92 }
93
94 applet->hWnd = hWnd;
95
96#ifdef __REACTOS__
97 StringCchCopy(fileBuffer, MAX_PATH, applet->cmd);
98 if (PathIsFileSpecW(fileBuffer))
99 SearchPath(NULL, fileBuffer, NULL, MAX_PATH, fileBuffer, NULL);
100 ActCtx.lpSource = fileBuffer;
101 ActCtx.lpResourceName = (LPCWSTR)123;
102 applet->hActCtx = CreateActCtx(&ActCtx);
103 bActivated = (applet->hActCtx != INVALID_HANDLE_VALUE ? ActivateActCtx(applet->hActCtx, &cookie) : FALSE);
104#endif
105
106 if (!(applet->hModule = LoadLibraryW(applet->cmd))) {
107 WARN("Cannot load control panel applet %s\n", debugstr_w(applet->cmd));
108 goto theError;
109 }
110 if (!(applet->proc = (APPLET_PROC)GetProcAddress(applet->hModule, "CPlApplet"))) {
111 WARN("Not a valid control panel applet %s\n", debugstr_w(applet->cmd));
112 goto theError;
113 }
114 if (!applet->proc(hWnd, CPL_INIT, 0L, 0L)) {
115 WARN("Init of applet has failed\n");
116 goto theError;
117 }
118 if ((applet->count = applet->proc(hWnd, CPL_GETCOUNT, 0L, 0L)) == 0) {
119 WARN("No subprogram in applet\n");
120 applet->proc(applet->hWnd, CPL_EXIT, 0, 0);
121 goto theError;
122 }
123
124 applet = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, applet,
125 FIELD_OFFSET( CPlApplet, info[applet->count] ));
126
127 for (i = 0; i < applet->count; i++) {
128 ZeroMemory(&newinfo, sizeof(newinfo));
129 newinfo.dwSize = sizeof(NEWCPLINFOA);
130 applet->info[i].helpfile[0] = 0;
131 /* proc is supposed to return a null value upon success for
132 * CPL_INQUIRE and CPL_NEWINQUIRE
133 * However, real drivers don't seem to behave like this
134 * So, use introspection rather than return value
135 */
136 applet->proc(hWnd, CPL_INQUIRE, i, (LPARAM)&info);
137 applet->info[i].data = info.lData;
138#ifdef __REACTOS__
139 applet->info[i].idIcon = info.idIcon;
140#endif
141
142 if (info.idIcon != CPL_DYNAMIC_RES)
143 applet->info[i].icon = LoadIconW(applet->hModule, MAKEINTRESOURCEW(info.idIcon));
144 if (info.idName != CPL_DYNAMIC_RES)
145 LoadStringW(applet->hModule, info.idName,
146 applet->info[i].name, sizeof(applet->info[i].name) / sizeof(WCHAR));
147 if (info.idInfo != CPL_DYNAMIC_RES)
148 LoadStringW(applet->hModule, info.idInfo,
149 applet->info[i].info, sizeof(applet->info[i].info) / sizeof(WCHAR));
150
151 /* some broken control panels seem to return incorrect values in CPL_INQUIRE,
152 but proper data in CPL_NEWINQUIRE. if we get an empty string or a null
153 icon, see what we can get from CPL_NEWINQUIRE */
154
155 if (!applet->info[i].name[0]) info.idName = CPL_DYNAMIC_RES;
156
157 /* zero-length szInfo may not be a buggy applet, but it doesn't hurt for us
158 to check anyway */
159
160 if (!applet->info[i].info[0]) info.idInfo = CPL_DYNAMIC_RES;
161
162 if (applet->info[i].icon == NULL)
163 info.idIcon = CPL_DYNAMIC_RES;
164
165 if ((info.idIcon == CPL_DYNAMIC_RES) || (info.idName == CPL_DYNAMIC_RES) ||
166 (info.idInfo == CPL_DYNAMIC_RES)) {
167 applet->proc(hWnd, CPL_NEWINQUIRE, i, (LPARAM)&newinfo);
168
169 applet->info[i].data = newinfo.lData;
170 if (info.idIcon == CPL_DYNAMIC_RES) {
171 if (!newinfo.hIcon) WARN("couldn't get icon for applet %u\n", i);
172 applet->info[i].icon = newinfo.hIcon;
173 }
174 if (newinfo.dwSize == sizeof(NEWCPLINFOW)) {
175 if (info.idName == CPL_DYNAMIC_RES)
176 memcpy(applet->info[i].name, newinfo.szName, sizeof(newinfo.szName));
177 if (info.idInfo == CPL_DYNAMIC_RES)
178 memcpy(applet->info[i].info, newinfo.szInfo, sizeof(newinfo.szInfo));
179 memcpy(applet->info[i].helpfile, newinfo.szHelpFile, sizeof(newinfo.szHelpFile));
180 } else {
181 if (info.idName == CPL_DYNAMIC_RES)
183 sizeof(((LPNEWCPLINFOA)&newinfo)->szName) / sizeof(CHAR),
184 applet->info[i].name, sizeof(applet->info[i].name) / sizeof(WCHAR));
185 if (info.idInfo == CPL_DYNAMIC_RES)
186 MultiByteToWideChar(CP_ACP, 0, ((LPNEWCPLINFOA)&newinfo)->szInfo,
187 sizeof(((LPNEWCPLINFOA)&newinfo)->szInfo) / sizeof(CHAR),
188 applet->info[i].info, sizeof(applet->info[i].info) / sizeof(WCHAR));
190 sizeof(((LPNEWCPLINFOA)&newinfo)->szHelpFile) / sizeof(CHAR),
191 applet->info[i].helpfile,
192 sizeof(applet->info[i].helpfile) / sizeof(WCHAR));
193 }
194 }
195 }
196
197#ifdef __REACTOS__
198 if (bActivated)
200#endif
201
202#ifndef __REACTOS__
203 list_add_head( &panel->applets, &applet->entry );
204#endif
205
206 return applet;
207
208 theError:
209 FreeLibrary(applet->hModule);
210 HeapFree(GetProcessHeap(), 0, applet->cmd);
211 HeapFree(GetProcessHeap(), 0, applet);
212 return NULL;
213}
214
215#ifndef __REACTOS__
216
217#define IDC_LISTVIEW 1000
218#define IDC_STATUSBAR 1001
219
220#define NUM_COLUMNS 2
221#define LISTVIEW_DEFSTYLE (WS_CHILD | WS_VISIBLE | WS_TABSTOP |\
222 LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL)
223
225{
226 RECT ws, sb;
227 WCHAR empty_string[] = {0};
229 LVCOLUMNW lvc;
230
231 /* Create list view */
233 GetClientRect(panel->hWnd, &ws);
234
236 empty_string, LISTVIEW_DEFSTYLE | LVS_ICON,
237 0, 0, ws.right - ws.left, ws.bottom - ws.top -
238 (sb.bottom - sb.top), panel->hWnd,
239 (HMENU) IDC_LISTVIEW, panel->hInst, NULL);
240
241 if (!panel->hWndListView)
242 return FALSE;
243
244 /* Create image lists for list view */
249
252
253 /* Create columns for list view */
255 lvc.pszText = buf;
256 lvc.fmt = LVCFMT_LEFT;
257
258 /* Name column */
259 lvc.iSubItem = 0;
260 lvc.cx = (ws.right - ws.left) / 3;
261 LoadStringW(shell32_hInstance, IDS_CPANEL_NAME, buf, sizeof(buf) / sizeof(buf[0]));
262
263 if (ListView_InsertColumnW(panel->hWndListView, 0, &lvc) == -1)
264 return FALSE;
265
266 /* Description column */
267 lvc.iSubItem = 1;
268 lvc.cx = ((ws.right - ws.left) / 3) * 2;
269 LoadStringW(shell32_hInstance, IDS_CPANEL_DESCRIPTION, buf, sizeof(buf) /
270 sizeof(buf[0]));
271
272 if (ListView_InsertColumnW(panel->hWndListView, 1, &lvc) == -1)
273 return FALSE;
274
275 return(TRUE);
276}
277
279{
280 CPanel* panel = cs->lpCreateParams;
281 HMENU hMenu, hSubMenu;
282 CPlApplet* applet;
283 MENUITEMINFOW mii;
284 unsigned int i;
285 int menucount, index;
286 CPlItem *item;
287 LVITEMW lvItem;
289 INT sb_parts;
290 int itemidx;
291
292 SetWindowLongPtrW(hWnd, 0, (LONG_PTR)panel);
293 panel->hWnd = hWnd;
294
295 /* Initialise common control DLL */
296 icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
299
300 /* create the status bar */
302 return;
303
304 sb_parts = -1;
305 SendMessageW(panel->hWndStatusBar, SB_SETPARTS, 1, (LPARAM) &sb_parts);
306
307 /* create the list view */
308 if (!Control_CreateListView(panel))
309 return;
310
311 hMenu = LoadMenuW(shell32_hInstance, MAKEINTRESOURCEW(MENU_CPANEL));
312
313 /* insert menu items for applets */
314 hSubMenu = GetSubMenu(hMenu, 0);
315 menucount = 0;
316
317 LIST_FOR_EACH_ENTRY( applet, &panel->applets, CPlApplet, entry )
318 {
319 for (i = 0; i < applet->count; i++) {
320 /* set up a CPlItem for this particular subprogram */
321 item = HeapAlloc(GetProcessHeap(), 0, sizeof(CPlItem));
322
323 if (!item)
324 continue;
325
326 item->applet = applet;
327 item->id = i;
328
329 mii.cbSize = sizeof(MENUITEMINFOW);
331 mii.dwTypeData = applet->info[i].name;
332 mii.cch = sizeof(applet->info[i].name) / sizeof(WCHAR);
333 mii.wID = IDM_CPANEL_APPLET_BASE + menucount;
335
336 if (InsertMenuItemW(hSubMenu, menucount, TRUE, &mii)) {
337 /* add the list view item */
338 HICON icon = applet->info[i].icon;
339 if (!icon) icon = LoadImageW( 0, (LPCWSTR)IDI_WINLOGO, IMAGE_ICON, 0, 0, LR_SHARED );
342
343 lvItem.mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM;
344 lvItem.iItem = menucount;
345 lvItem.iSubItem = 0;
346 lvItem.pszText = applet->info[i].name;
347 lvItem.iImage = index;
348 lvItem.lParam = (LPARAM) item;
349
350 itemidx = ListView_InsertItemW(panel->hWndListView, &lvItem);
351
352 /* add the description */
353 ListView_SetItemTextW(panel->hWndListView, itemidx, 1, applet->info[i].info);
354
355 /* update menu bar, increment count */
357 menucount++;
358 }
359 }
360 }
361
362 panel->total_subprogs = menucount;
363
364 /* check the "large items" icon in the View menu */
365 hSubMenu = GetSubMenu(hMenu, 1);
368
369 SetMenu(hWnd, hMenu);
370}
371
373{
374 HMENU hMenu, hSubMenu;
375 MENUITEMINFOW mii;
376 unsigned int i;
377
378 /* get the File menu */
379 hMenu = GetMenu(hWnd);
380
381 if (!hMenu)
382 return;
383
384 hSubMenu = GetSubMenu(hMenu, 0);
385
386 if (!hSubMenu)
387 return;
388
389 /* loop and free the item data */
390 for (i = IDM_CPANEL_APPLET_BASE; i <= IDM_CPANEL_APPLET_BASE + panel->total_subprogs; i++)
391 {
392 mii.cbSize = sizeof(MENUITEMINFOW);
393 mii.fMask = MIIM_DATA;
394
395 if (!GetMenuItemInfoW(hSubMenu, i, FALSE, &mii))
396 continue;
397
399 }
400}
401
403{
404 HMENU hMenu, hSubMenu;
405
407
408 /* update the menu */
409 hMenu = GetMenu(panel->hWnd);
410 hSubMenu = GetSubMenu(hMenu, 1);
411
413 id, MF_BYCOMMAND);
414}
415
417{
418 HMENU hMenu, hSubMenu;
419 MENUITEMINFOW mii;
420
421 /* retrieve the CPlItem structure from the menu item data */
422 hMenu = GetMenu(hWnd);
423
424 if (!hMenu)
425 return NULL;
426
427 hSubMenu = GetSubMenu(hMenu, 0);
428
429 if (!hSubMenu)
430 return NULL;
431
432 mii.cbSize = sizeof(MENUITEMINFOW);
433 mii.fMask = MIIM_DATA;
434
435 if (!GetMenuItemInfoW(hSubMenu, id, FALSE, &mii))
436 return NULL;
437
438 return (CPlItem *) mii.dwItemData;
439}
440
442{
443 LVITEMW lvItem;
444 int selitem;
445
447 | LVNI_SELECTED);
448
449 if (selitem != -1)
450 {
451 lvItem.iItem = selitem;
452 lvItem.mask = LVIF_PARAM;
453
454 if (SendMessageW(panel->hWndListView, LVM_GETITEMW, 0, (LPARAM) &lvItem))
455 return (CPlItem *) lvItem.lParam;
456 }
457
458 return NULL;
459}
460
462{
463 WCHAR verbOpen[] = {'c','p','l','o','p','e','n',0};
464 WCHAR format[] = {'@','%','d',0};
466
467 /* execute the applet if item is valid */
468 if (item)
469 {
470 wsprintfW(param, format, item->id);
471 ShellExecuteW(hWnd, verbOpen, item->applet->cmd, param, NULL, SW_SHOW);
472 }
473}
474
476 WPARAM lParam1, LPARAM lParam2)
477{
478 CPanel* panel = (CPanel*)GetWindowLongPtrW(hWnd, 0);
479
480 if (panel || wMsg == WM_CREATE) {
481 switch (wMsg) {
482 case WM_CREATE:
484 return 0;
485 case WM_DESTROY:
486 {
487 CPlApplet *applet, *next;
489 Control_UnloadApplet(applet);
490 }
493 break;
494 case WM_COMMAND:
495 switch (LOWORD(lParam1))
496 {
497 case IDM_CPANEL_EXIT:
498 SendMessageW(hWnd, WM_CLOSE, 0, 0);
499 return 0;
500
501 case IDM_CPANEL_ABOUT:
502 {
505 IMAGE_ICON, 48, 48, LR_SHARED);
506
507 LoadStringW(shell32_hInstance, IDS_CPANEL_TITLE, appName,
508 sizeof(appName) / sizeof(appName[0]));
509 ShellAboutW(hWnd, appName, NULL, icon);
510
511 return 0;
512 }
513
516 return 0;
517
520 return 0;
521
524 return 0;
525
528 return 0;
529
530 default:
531 /* check if this is an applet */
532 if ((LOWORD(lParam1) >= IDM_CPANEL_APPLET_BASE) &&
533 (LOWORD(lParam1) <= IDM_CPANEL_APPLET_BASE + panel->total_subprogs))
534 {
536 return 0;
537 }
538
539 break;
540 }
541
542 break;
543
544 case WM_NOTIFY:
545 {
546 LPNMHDR nmh = (LPNMHDR) lParam2;
547
548 switch (nmh->idFrom)
549 {
550 case IDC_LISTVIEW:
551 switch (nmh->code)
552 {
553 case NM_RETURN:
554 case NM_DBLCLK:
555 {
557 return 0;
558 }
559 case LVN_ITEMCHANGED:
560 {
562
563 /* update the status bar if item is valid */
564 if (item)
565 SetWindowTextW(panel->hWndStatusBar, item->applet->info[item->id].info);
566 else
568
569 return 0;
570 }
571 }
572
573 break;
574 }
575
576 break;
577 }
578
579 case WM_MENUSELECT:
580 /* check if this is an applet */
581 if ((LOWORD(lParam1) >= IDM_CPANEL_APPLET_BASE) &&
582 (LOWORD(lParam1) <= IDM_CPANEL_APPLET_BASE + panel->total_subprogs))
583 {
585
586 /* update the status bar if item is valid */
587 if (item)
588 SetWindowTextW(panel->hWndStatusBar, item->applet->info[item->id].info);
589 }
590 else if ((HIWORD(lParam1) == 0xFFFF) && (lParam2 == 0))
591 {
592 /* reset status bar description to that of the selected icon */
594
595 if (item)
596 SetWindowTextW(panel->hWndStatusBar, item->applet->info[item->id].info);
597 else
599
600 return 0;
601 }
602 else
604
605 return 0;
606
607 case WM_SIZE:
608 {
609 HDWP hdwp;
610 RECT sb;
611
612 hdwp = BeginDeferWindowPos(2);
613
614 if (hdwp == NULL)
615 break;
616
618
619 hdwp = DeferWindowPos(hdwp, panel->hWndListView, NULL, 0, 0,
620 LOWORD(lParam2), HIWORD(lParam2) - (sb.bottom - sb.top),
622
623 if (hdwp == NULL)
624 break;
625
626 hdwp = DeferWindowPos(hdwp, panel->hWndStatusBar, NULL, 0, 0,
627 LOWORD(lParam2), LOWORD(lParam1), SWP_NOZORDER | SWP_NOMOVE);
628
629 if (hdwp != NULL)
630 EndDeferWindowPos(hdwp);
631
632 return 0;
633 }
634 }
635 }
636
637 return DefWindowProcW(hWnd, wMsg, lParam1, lParam2);
638}
639
641{
642 WNDCLASSEXW wc;
643 MSG msg;
645 const WCHAR className[] = {'S','h','e','l','l','_','C','o','n','t','r','o',
646 'l','_','W','n','d','C','l','a','s','s',0};
647
648 LoadStringW(shell32_hInstance, IDS_CPANEL_TITLE, appName, sizeof(appName) / sizeof(appName[0]));
649
650 wc.cbSize = sizeof(wc);
653 wc.cbClsExtra = 0;
654 wc.cbWndExtra = sizeof(CPlApplet*);
655 wc.hInstance = panel->hInst = hInst;
659 wc.lpszMenuName = NULL;
660 wc.lpszClassName = className;
663
664 if (!RegisterClassExW(&wc)) return;
665
670 hWnd, NULL, hInst, panel);
671 if (!panel->hWnd) return;
672
673 while (GetMessageW(&msg, panel->hWnd, 0, 0)) {
676 }
677}
678
679static void Control_RegisterRegistryApplets(HWND hWnd, CPanel *panel, HKEY hkey_root, LPCWSTR szRepPath)
680{
683 HKEY hkey;
684
685 if (RegOpenKeyW(hkey_root, szRepPath, &hkey) == ERROR_SUCCESS)
686 {
687 int idx = 0;
688
689 for(;; ++idx)
690 {
691 DWORD nameLen = MAX_PATH;
692 DWORD valueLen = MAX_PATH;
693
694 if (RegEnumValueW(hkey, idx, name, &nameLen, NULL, NULL, (LPBYTE)value, &valueLen) != ERROR_SUCCESS)
695 break;
696
698 }
699 RegCloseKey(hkey);
700 }
701}
702
704{
705 static const WCHAR wszRegPath[] = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls";
706 HANDLE h;
709 WCHAR *p;
710
711 /* first add .cpl files in the system directory */
713 p = buffer + strlenW(buffer);
714 *p++ = '\\';
715 lstrcpyW(p, L"*.cpl");
716
718 do {
719 lstrcpyW(p, fd.cFileName);
721 } while (FindNextFileW(h, &fd));
722 FindClose(h);
723 }
724
725 /* now check for cpls in the registry */
728
730}
731
732#else
733static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst)
734{
736 L"open",
737 L"explorer.exe",
738 L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}",
739 NULL,
741}
742#endif
743
744#ifdef __REACTOS__
745
749typedef struct tagAppDlgFindData
750{
751 PCWSTR szAppFile;
752 UINT_PTR sAppletNo;
753 ATOM aCPLName;
754 ATOM aCPLFlags;
755 HWND hRunDLL;
756 HWND hDlgResult;
757} AppDlgFindData;
758
765static BOOL CALLBACK
766Control_EnumWinProc(
767 _In_ HWND hwnd,
769{
770 AppDlgFindData* pData = (AppDlgFindData*)lParam;
771 UINT_PTR sAppletNo;
772 HANDLE hRes;
773 WCHAR szAppFile[MAX_PATH];
774
775 if (pData->hRunDLL == hwnd)
776 return TRUE; /* Skip self instance */
777
778 sAppletNo = (UINT_PTR)GetPropW(hwnd, (LPTSTR)MAKEINTATOM(pData->aCPLFlags));
779 if (sAppletNo != pData->sAppletNo)
780 return TRUE; /* Continue enumeration */
781
782 hRes = GetPropW(hwnd, (LPTSTR)MAKEINTATOM(pData->aCPLName));
783 GlobalGetAtomNameW((ATOM)HandleToUlong(hRes), szAppFile, _countof(szAppFile));
784 if (wcscmp(szAppFile, pData->szAppFile) == 0)
785 {
786 HWND hDialog = GetLastActivePopup(hwnd);
787 if (IsWindow(hDialog))
788 {
789 pData->hDlgResult = hDialog;
790 return FALSE; /* Stop enumeration */
791 }
792 }
793
794 return TRUE; /* Continue enumeration */
795}
796
806static void
807Control_ShowAppletInTaskbar(CPlApplet* applet, UINT index)
808{
809 HICON hSmallIcon;
810 ITaskbarList* pTaskbar = NULL;
811
812 /* Try to add a taskbar button only if the applet's parent window is the desktop */
813 if (GetParent(applet->hWnd) != NULL)
814 {
815 return;
816 }
817
818 SetWindowTextW(applet->hWnd, applet->info[index].name);
819
820 /* Set large icon for the taskbar button */
821 if (applet->info[index].icon)
822 {
823 SendMessageW(applet->hWnd, WM_SETICON, ICON_BIG, (LPARAM)applet->info[index].icon);
824 }
825
826 /* Try loading the small icon for the taskbar button */
827 hSmallIcon = (HICON)LoadImageW(applet->hModule,
828 MAKEINTRESOURCEW(applet->info[index].idIcon),
832 0);
833 if (hSmallIcon)
834 {
835 SendMessageW(applet->hWnd, WM_SETICON, ICON_SMALL, (LPARAM)hSmallIcon);
836 }
837 else
838 {
839 if (applet->info[index].icon)
840 {
841 SendMessageW(applet->hWnd, WM_SETICON, ICON_SMALL, (LPARAM)applet->info[index].icon);
842 }
843 }
844
845 /* Add button to the taskbar */
847
848 /* Activate the corresponding button in the taskbar */
850 if (CoCreateInstance(&CLSID_TaskbarList,
851 NULL, CLSCTX_INPROC_SERVER,
852 &IID_ITaskbarList,
853 (LPVOID*)&pTaskbar) == S_OK)
854 {
855 if (ITaskbarList_HrInit(pTaskbar) == S_OK)
856 {
857 ITaskbarList_ActivateTab(pTaskbar, applet->hWnd);
858 }
859 ITaskbarList_Release(pTaskbar);
860 }
862}
863
864#endif /* __REACTOS__ */
865
866static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
867 /* forms to parse:
868 * foo.cpl,@sp,str
869 * foo.cpl,@sp
870 * foo.cpl,,str
871 * foo.cpl @sp
872 * foo.cpl str
873 * "a path\foo.cpl"
874 */
875{
877 LPWSTR beg = NULL;
878 LPWSTR end;
879 WCHAR ch;
880 LPWSTR ptr;
881 signed sp = -1;
882 LPWSTR extraPmtsBuf = NULL;
883 LPWSTR extraPmts = NULL;
884 BOOL quoted = FALSE;
885 CPlApplet *applet;
886
887 buffer = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(wszCmd) + 1) * sizeof(*wszCmd));
888 if (!buffer) return;
889
890 end = lstrcpyW(buffer, wszCmd);
891
892 for (;;) {
893 ch = *end;
894 if (ch == '"') quoted = !quoted;
895 if (!quoted && (ch == ' ' || ch == ',' || ch == '\0')) {
896 *end = '\0';
897 if (beg) {
898 if (*beg == '@') {
899 sp = atoiW(beg + 1);
900 } else if (*beg == '\0') {
901 sp = -1;
902 } else {
903 extraPmtsBuf = beg;
904 }
905 }
906 if (ch == '\0') break;
907 beg = end + 1;
908 if (ch == ' ') while (end[1] == ' ') end++;
909 }
910 end++;
911 }
912 while ((ptr = StrChrW(buffer, '"')))
913 memmove(ptr, ptr+1, lstrlenW(ptr)*sizeof(WCHAR));
914
915 /* now check for any quotes in extraPmtsBuf and remove */
916 if (extraPmtsBuf != NULL)
917 {
918 beg = end = extraPmtsBuf;
919 quoted = FALSE;
920
921 for (;;) {
922 ch = *end;
923 if (ch == '"') quoted = !quoted;
924 if (!quoted && (ch == ' ' || ch == ',' || ch == '\0')) {
925 *end = '\0';
926 if (beg) {
927 if (*beg != '\0') {
928 extraPmts = beg;
929 }
930 }
931 if (ch == '\0') break;
932 beg = end + 1;
933 if (ch == ' ') while (end[1] == ' ') end++;
934 }
935 end++;
936 }
937
938 while ((ptr = StrChrW(extraPmts, '"')))
939 memmove(ptr, ptr+1, lstrlenW(ptr)*sizeof(WCHAR));
940
941 if (extraPmts == NULL)
942 extraPmts = extraPmtsBuf;
943 }
944
945 /* Now check if there had been a numerical value in the extra params */
946 if ((extraPmts) && (*extraPmts == '@') && (sp == -1)) {
947 sp = atoiW(extraPmts + 1);
948 }
949
950 TRACE("cmd %s, extra %s, sp %d\n", debugstr_w(buffer), debugstr_w(extraPmts), sp);
951
952 applet = Control_LoadApplet(hWnd, buffer, panel);
953 if (applet)
954 {
955#ifdef __REACTOS__
957 BOOL bActivated;
958 ATOM aCPLName;
959 ATOM aCPLFlags;
960 ATOM aCPLPath;
961 AppDlgFindData findData;
962#endif
963 /* we've been given a textual parameter (or none at all) */
964 if (sp == -1) {
965 while ((++sp) != applet->count) {
966 TRACE("sp %d, name %s\n", sp, debugstr_w(applet->info[sp].name));
967
968 if (StrCmpIW(extraPmts, applet->info[sp].name) == 0)
969 break;
970 }
971 }
972
973 if (sp >= applet->count) {
974 WARN("Out of bounds (%u >= %u), setting to 0\n", sp, applet->count);
975 sp = 0;
976 }
977
978#ifdef __REACTOS__
979 bActivated = (applet->hActCtx != INVALID_HANDLE_VALUE ? ActivateActCtx(applet->hActCtx, &cookie) : FALSE);
980
981 aCPLPath = GlobalFindAtomW(applet->cmd);
982 if (!aCPLPath)
983 {
984 aCPLPath = GlobalAddAtomW(applet->cmd);
985 }
986
987 aCPLName = GlobalFindAtomW(L"CPLName");
988 if (!aCPLName)
989 {
990 aCPLName = GlobalAddAtomW(L"CPLName");
991 }
992
993 aCPLFlags = GlobalFindAtomW(L"CPLFlags");
994 if (!aCPLFlags)
995 {
996 aCPLFlags = GlobalAddAtomW(L"CPLFlags");
997 }
998
999 findData.szAppFile = applet->cmd;
1000 findData.sAppletNo = (UINT_PTR)(sp + 1);
1001 findData.aCPLName = aCPLName;
1002 findData.aCPLFlags = aCPLFlags;
1003 findData.hRunDLL = applet->hWnd;
1004 findData.hDlgResult = NULL;
1005 // Find the dialog of this applet in the first instance.
1006 // Note: The simpler functions "FindWindow" or "FindWindowEx" does not find this type of dialogs.
1007 EnumWindows(Control_EnumWinProc, (LPARAM)&findData);
1008 if (findData.hDlgResult)
1009 {
1010 BringWindowToTop(findData.hDlgResult);
1011 }
1012 else
1013 {
1014 SetPropW(applet->hWnd, (LPTSTR)MAKEINTATOM(aCPLName), (HANDLE)MAKEINTATOM(aCPLPath));
1015 SetPropW(applet->hWnd, (LPTSTR)MAKEINTATOM(aCPLFlags), UlongToHandle(sp + 1));
1016 Control_ShowAppletInTaskbar(applet, sp);
1017#endif
1018
1019 if (!applet->proc(applet->hWnd, CPL_STARTWPARMSW, sp, (LPARAM)extraPmts))
1020 applet->proc(applet->hWnd, CPL_DBLCLK, sp, applet->info[sp].data);
1021#ifdef __REACTOS__
1022 RemovePropW(applet->hWnd, applet->cmd);
1023 GlobalDeleteAtom(aCPLPath);
1024 }
1025#endif
1026
1027 Control_UnloadApplet(applet);
1028
1029#ifdef __REACTOS__
1030 if (bActivated)
1032#endif
1033
1034 }
1035
1037}
1038
1039/*************************************************************************
1040 * Control_RunDLLW [SHELL32.@]
1041 *
1042 */
1044{
1045 CPanel panel;
1046
1047 TRACE("(%p, %p, %s, 0x%08x)\n",
1048 hWnd, hInst, debugstr_w(cmd), nCmdShow);
1049
1050#ifndef __REACTOS__
1051 memset(&panel, 0, sizeof(panel));
1052 list_init( &panel.applets );
1053#endif
1054
1055 if (!cmd || !*cmd) {
1056 Control_DoWindow(&panel, hWnd, hInst);
1057 } else {
1058 Control_DoLaunch(&panel, hWnd, cmd);
1059 }
1060}
1061
1062/*************************************************************************
1063 * Control_RunDLLA [SHELL32.@]
1064 *
1065 */
1067{
1068 DWORD len = MultiByteToWideChar(CP_ACP, 0, cmd, -1, NULL, 0 );
1069 LPWSTR wszCmd = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
1070 if (wszCmd && MultiByteToWideChar(CP_ACP, 0, cmd, -1, wszCmd, len ))
1071 {
1072 Control_RunDLLW(hWnd, hInst, wszCmd, nCmdShow);
1073 }
1074 HeapFree(GetProcessHeap(), 0, wszCmd);
1075}
1076
1077/*************************************************************************
1078 * Control_FillCache_RunDLLW [SHELL32.@]
1079 *
1080 */
1082{
1083 FIXME("%p %p 0x%08x 0x%08x stub\n", hWnd, hModule, w, x);
1084 return S_OK;
1085}
1086
1087/*************************************************************************
1088 * Control_FillCache_RunDLLA [SHELL32.@]
1089 *
1090 */
1092{
1094}
1095
1096
1097#ifdef __REACTOS__
1098/*************************************************************************
1099 * RunDll_CallEntry16 [SHELL32.122]
1100 * the name is OK (when written with Dll, and not DLL as in Wine!)
1101 */
1102void WINAPI RunDll_CallEntry16( DWORD proc, HWND hwnd, HINSTANCE inst,
1103 LPCSTR cmdline, INT cmdshow )
1104{
1105 FIXME( "proc %lx hwnd %p inst %p cmdline %s cmdshow %d\n",
1106 proc, hwnd, inst, debugstr_a(cmdline), cmdshow );
1107}
1108#endif
1109
1110/*************************************************************************
1111 * CallCPLEntry16 [SHELL32.166]
1112 *
1113 * called by desk.cpl on "Advanced" with:
1114 * hMod("DeskCp16.Dll"), pFunc("CplApplet"), 0, 1, 0xc, 0
1115 *
1116 */
1117#ifndef __REACTOS__
1119#else
1121LRESULT WINAPI CallCPLEntry16(HINSTANCE hMod, FARPROC16 pFunc, HWND dw3, UINT dw4, LPARAM dw5, LPARAM dw6)
1122#endif
1123{
1124 FIXME("(%p, %p, %08x, %08x, %08x, %08x): stub.\n", hMod, pFunc, dw3, dw4, dw5, dw6);
1125 return 0x0deadbee;
1126}
#define shell32_hInstance
Arabic default style
Definition: afstyles.h:94
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define MAX_STRING_LEN
Definition: precomp.h:36
VOID WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
Definition: control.c:1043
#define index(s, c)
Definition: various.h:29
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
static void list_init(struct list_entry *head)
Definition: list.h:51
#define UlongToHandle(ul)
Definition: basetsd.h:97
#define HandleToUlong(h)
Definition: basetsd.h:79
#define FIXME(fmt,...)
Definition: debug.h:111
#define WARN(fmt,...)
Definition: debug.h:112
#define RegCloseKey(hKey)
Definition: registry.h:49
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
HWND WINAPI CreateStatusWindowW(LONG style, LPCWSTR text, HWND parent, UINT wid)
Definition: commctrl.c:795
#define CPL_INQUIRE
Definition: cpl.h:14
#define CPL_DYNAMIC_RES
Definition: cpl.h:11
LONG(APIENTRY * APPLET_PROC)(HWND, UINT, LPARAM, LPARAM)
Definition: cpl.h:23
struct tagNEWCPLINFOA NEWCPLINFOA
#define CPL_DBLCLK
Definition: cpl.h:16
#define CPL_STARTWPARMSW
Definition: cpl.h:21
#define CPL_INIT
Definition: cpl.h:12
#define CPL_EXIT
Definition: cpl.h:18
#define CPL_GETCOUNT
Definition: cpl.h:13
#define CPL_NEWINQUIRE
Definition: cpl.h:19
#define CPL_STOP
Definition: cpl.h:17
#define ERROR_SUCCESS
Definition: deptool.c:10
WORD ATOM
Definition: dimm.idl:113
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int idx
Definition: utils.c:41
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
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:2830
HMODULE hModule
Definition: animate.c:44
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
Definition: string.c:468
#define GetProcessHeap()
Definition: compat.h:736
int(* FARPROC)()
Definition: compat.h:36
#define CP_ACP
Definition: compat.h:109
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define HeapReAlloc
Definition: compat.h:734
#define FreeLibrary(x)
Definition: compat.h:748
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define lstrcpyW
Definition: compat.h:749
#define MultiByteToWideChar
Definition: compat.h:110
#define LoadLibraryW(x)
Definition: compat.h:747
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define lstrlenW
Definition: compat.h:750
BOOL WINAPI DeactivateActCtx(IN DWORD dwFlags, IN ULONG_PTR ulCookie)
Definition: actctx.c:268
BOOL WINAPI ActivateActCtx(IN HANDLE hActCtx, OUT PULONG_PTR ulCookie)
Definition: actctx.c:237
ATOM WINAPI GlobalFindAtomW(LPCWSTR lpString)
Definition: atom.c:474
UINT WINAPI GlobalGetAtomNameW(ATOM nAtom, LPWSTR lpBuffer, int nSize)
Definition: atom.c:496
ATOM WINAPI GlobalDeleteAtom(ATOM nAtom)
Definition: atom.c:454
ATOM WINAPI GlobalAddAtomW(LPCWSTR lpString)
Definition: atom.c:444
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
CPlApplet * Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel *panel)
Definition: control.c:61
DWORD WINAPI CallCPLEntry16(HMODULE hMod, FARPROC pFunc, DWORD dw3, DWORD dw4, DWORD dw5, DWORD dw6)
Definition: control.c:1118
HRESULT WINAPI Control_FillCache_RunDLLA(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)
Definition: control.c:1091
void Control_UnloadApplet(CPlApplet *applet)
Definition: control.c:45
#define IDC_STATUSBAR
Definition: control.c:218
#define IDC_LISTVIEW
Definition: control.c:217
static CPlItem * Control_GetCPlItem_From_ListView(CPanel *panel)
Definition: control.c:441
static void Control_DoInterface(CPanel *panel, HWND hWnd, HINSTANCE hInst)
Definition: control.c:640
static BOOL Control_CreateListView(CPanel *panel)
Definition: control.c:224
static void Control_StartApplet(HWND hWnd, CPlItem *item)
Definition: control.c:461
static void Control_RegisterRegistryApplets(HWND hWnd, CPanel *panel, HKEY hkey_root, LPCWSTR szRepPath)
Definition: control.c:679
static CPlItem * Control_GetCPlItem_From_MenuID(HWND hWnd, UINT id)
Definition: control.c:416
void WINAPI Control_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow)
Definition: control.c:1066
static void Control_DoWindow(CPanel *panel, HWND hWnd, HINSTANCE hInst)
Definition: control.c:703
#define LISTVIEW_DEFSTYLE
Definition: control.c:221
static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg, WPARAM lParam1, LPARAM lParam2)
Definition: control.c:475
static void Control_WndProc_Create(HWND hWnd, const CREATESTRUCTW *cs)
Definition: control.c:278
HRESULT WINAPI Control_FillCache_RunDLLW(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)
Definition: control.c:1081
static void Control_FreeCPlItems(HWND hWnd, CPanel *panel)
Definition: control.c:372
static void Control_DoLaunch(CPanel *panel, HWND hWnd, LPCWSTR wszCmd)
Definition: control.c:866
static void Control_UpdateListViewStyle(CPanel *panel, UINT style, UINT id)
Definition: control.c:402
BOOL WINAPI PathIsFileSpecW(LPCWSTR lpszPath)
Definition: path.c:2133
int WINAPI StrCmpIW(LPCWSTR lpszStr, LPCWSTR lpszComp)
Definition: string.c:353
superblock * sb
Definition: btrfs.c:4261
#define ULONG_PTR
Definition: config.h:101
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint end
Definition: gl.h:1545
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLuint buffer
Definition: glext.h:5915
GLuint index
Definition: glext.h:6031
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLfloat GLfloat p
Definition: glext.h:8902
GLfloat param
Definition: glext.h:5796
GLenum GLsizei len
Definition: glext.h:6722
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
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
#define cs
Definition: i386-dis.c:442
#define S_OK
Definition: intsafe.h:52
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
_In_ PCWSTR _Out_ PVOID * ActCtx
Definition: ldrtypes.h:247
const char * appName(const char *argv0)
Definition: loadlib.c:89
#define DECLARE_HANDLE(name)
Definition: mimeole.idl:23
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static PVOID ptr
Definition: dispmode.c:27
static HICON
Definition: imagelist.c:84
static const WCHAR sp[]
Definition: suminfo.c:287
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
static ATOM item
Definition: dde.c:856
#define _In_
Definition: ms_sal.h:308
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
static HANDLE proc()
Definition: pdb.c:34
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_VISIBLE
Definition: pedump.c:620
static const WCHAR szName[]
Definition: powrprof.c:45
#define LVSIL_SMALL
Definition: commctrl.h:2299
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define LVS_ICON
Definition: commctrl.h:2261
#define NM_DBLCLK
Definition: commctrl.h:131
#define WC_LISTVIEWW
Definition: commctrl.h:2257
#define LVNI_SELECTED
Definition: commctrl.h:2424
#define CCS_BOTTOM
Definition: commctrl.h:2244
#define LVS_REPORT
Definition: commctrl.h:2262
#define LVS_SMALLICON
Definition: commctrl.h:2263
#define LVCF_WIDTH
Definition: commctrl.h:2587
#define LVNI_FOCUSED
Definition: commctrl.h:2423
#define LVM_SETIMAGELIST
Definition: commctrl.h:2303
#define ILC_COLOR32
Definition: commctrl.h:358
#define LVM_GETNEXTITEM
Definition: commctrl.h:2433
#define NM_RETURN
Definition: commctrl.h:132
#define LVIF_PARAM
Definition: commctrl.h:2311
#define LVIF_TEXT
Definition: commctrl.h:2309
#define LVCF_FMT
Definition: commctrl.h:2586
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define LVCF_SUBITEM
Definition: commctrl.h:2589
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define ILC_MASK
Definition: commctrl.h:351
#define SB_SETPARTS
Definition: commctrl.h:1954
#define SBARS_SIZEGRIP
Definition: commctrl.h:1923
#define LVIF_IMAGE
Definition: commctrl.h:2310
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
#define LVN_ITEMCHANGED
Definition: commctrl.h:3131
#define LVCF_TEXT
Definition: commctrl.h:2588
#define LVM_GETITEMW
Definition: commctrl.h:2390
#define LVS_LIST
Definition: commctrl.h:2264
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58
#define LVSIL_NORMAL
Definition: commctrl.h:2298
static unsigned __int64 next
Definition: rand_nt.c:6
#define ListView_InsertItemW(hwnd, pitem)
Definition: commctrl.h:33
#define atoiW(s)
Definition: unicode.h:54
#define strlenW(s)
Definition: unicode.h:28
#define WM_NOTIFY
Definition: richedit.h:61
TCHAR szHelpFile[]
Definition: scrnsave.c:31
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
static int fd
Definition: io.c:51
#define memset(x, y, z)
Definition: compat.h:39
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2402
#define FCIDM_SHVIEW_LISTVIEW
Definition: shresdef.h:838
#define FCIDM_SHVIEW_BIGICON
Definition: shresdef.h:836
#define FCIDM_SHVIEW_SMALLICON
Definition: shresdef.h:837
#define FCIDM_SHVIEW_REPORTVIEW
Definition: shresdef.h:839
#define IDI_SHELL_CONTROL_PANEL
Definition: shresdef.h:572
const char * ws
Definition: skip_ws.cpp:7
#define _countof(array)
Definition: sndvol32.h:68
#define TRACE(s)
Definition: solgame.cpp:4
TCHAR * cmdline
Definition: stretchblt.cpp:32
#define StringCchCopy
Definition: strsafe.h:139
Definition: cpanel.h:56
HIMAGELIST hImageListLarge
Definition: cpanel.h:62
struct list applets
Definition: cpanel.h:57
HIMAGELIST hImageListSmall
Definition: cpanel.h:63
unsigned total_subprogs
Definition: cpanel.h:60
HINSTANCE hInst
Definition: cpanel.h:59
HWND hWndStatusBar
Definition: cpanel.h:64
HWND hWndListView
Definition: cpanel.h:61
HWND hWnd
Definition: cpanel.h:58
HMODULE hModule
Definition: cpanel.h:50
struct applet_info info[1]
Definition: cpanel.h:52
LPWSTR cmd
Definition: cpanel.h:48
APPLET_PROC proc
Definition: cpanel.h:51
HWND hWnd
Definition: cpanel.h:47
struct list entry
Definition: cpanel.h:43
unsigned count
Definition: cpanel.h:49
Definition: cpanel.h:68
LPCWSTR lpszClassName
Definition: winuser.h:3226
LPCWSTR lpszMenuName
Definition: winuser.h:3225
HBRUSH hbrBackground
Definition: winuser.h:3224
WNDPROC lpfnWndProc
Definition: winuser.h:3218
UINT cbSize
Definition: winuser.h:3216
int cbWndExtra
Definition: winuser.h:3220
HCURSOR hCursor
Definition: winuser.h:3223
HICON hIconSm
Definition: winuser.h:3227
HINSTANCE hInstance
Definition: winuser.h:3221
UINT style
Definition: winuser.h:3217
int cbClsExtra
Definition: winuser.h:3219
HICON hIcon
Definition: winuser.h:3222
Definition: ftp_var.h:139
Definition: cookie.c:34
Definition: name.c:39
Definition: cpl.h:24
LPWSTR pszText
Definition: commctrl.h:2567
LPWSTR pszText
Definition: commctrl.h:2365
int iSubItem
Definition: commctrl.h:2362
UINT mask
Definition: commctrl.h:2360
LPARAM lParam
Definition: commctrl.h:2368
int iImage
Definition: commctrl.h:2367
ULONG_PTR dwItemData
Definition: winuser.h:3268
LPWSTR dwTypeData
Definition: winuser.h:3269
DWORD dwSize
Definition: cpl.h:41
UINT_PTR idFrom
Definition: winuser.h:3158
UINT code
Definition: winuser.h:3159
#define ICON_BIG
Definition: tnclass.cpp:51
#define ICON_SMALL
Definition: tnclass.cpp:48
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define HIWORD(l)
Definition: typedefs.h:247
Definition: pdh_main.c:94
#define ZeroMemory
Definition: winbase.h:1712
#define MAKEINTATOM(i)
Definition: winbase.h:1463
#define SearchPath
Definition: winbase.h:3900
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LRESULT(CALLBACK * FARPROC16)()
Definition: windef16.h:156
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define WHITE_BRUSH
Definition: wingdi.h:902
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define CS_VREDRAW
Definition: winuser.h:658
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define WM_CLOSE
Definition: winuser.h:1621
BOOL WINAPI SetMenu(_In_ HWND, _In_opt_ HMENU)
#define MF_BYCOMMAND
Definition: winuser.h:202
#define MIIM_STRING
Definition: winuser.h:727
#define GetWindowLongPtrW
Definition: winuser.h:4829
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define MIIM_ID
Definition: winuser.h:722
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define IMAGE_ICON
Definition: winuser.h:212
HWND WINAPI GetLastActivePopup(_In_ HWND)
#define WM_CREATE
Definition: winuser.h:1608
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SIZE
Definition: winuser.h:1611
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
#define SWP_NOMOVE
Definition: winuser.h:1244
#define WM_COMMAND
Definition: winuser.h:1740
#define CS_HREDRAW
Definition: winuser.h:653
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2203
#define IDC_ARROW
Definition: winuser.h:687
#define SM_CYSMICON
Definition: winuser.h:1013
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2105
#define IDI_WINLOGO
Definition: winuser.h:709
#define SW_SHOWDEFAULT
Definition: winuser.h:780
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define SM_CXSMICON
Definition: winuser.h:1012
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SM_CYICON
Definition: winuser.h:973
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
BOOL WINAPI DrawMenuBar(_In_ HWND)
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 SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
struct tagNMHDR * LPNMHDR
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define LR_SHARED
Definition: winuser.h:1100
#define CW_USEDEFAULT
Definition: winuser.h:225
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
HWND WINAPI GetParent(_In_ HWND)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SW_SHOW
Definition: winuser.h:775
#define WM_DESTROY
Definition: winuser.h:1609
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define SWP_NOZORDER
Definition: winuser.h:1247
#define SetWindowLongPtrW
Definition: winuser.h:5346
#define GWL_STYLE
Definition: winuser.h:852
#define SM_CXICON
Definition: winuser.h:972
#define WM_MENUSELECT
Definition: winuser.h:1747
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2075
int WINAPI GetSystemMetrics(_In_ int)
#define MIIM_DATA
Definition: winuser.h:726
#define SW_SHOWMINNOACTIVE
Definition: winuser.h:777
BOOL WINAPI BringWindowToTop(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMENU WINAPI GetMenu(_In_ HWND)
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
struct tagMENUITEMINFOW MENUITEMINFOW
HDWP WINAPI BeginDeferWindowPos(_In_ int)
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
CHAR * LPTSTR
Definition: xmlstorage.h:192
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char CHAR
Definition: xmlstorage.h:175