ReactOS 0.4.15-dev-5667-ged97270
CControlPanelFolder.cpp
Go to the documentation of this file.
1/*
2 * Control panel folder
3 *
4 * Copyright 2003 Martin Fuchs
5 * Copyright 2009 Andrew Hill
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 <precomp.h>
23
25
26/***********************************************************************
27* control panel implementation in shell namespace
28*/
29
31 public CEnumIDListBase
32{
33 public:
38 int RegisterRegistryCPanelApps(HKEY hkey_root, LPCWSTR szRepPath);
40
42 COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
44};
45
46/***********************************************************************
47* IShellFolder [ControlPanel] implementation
48*/
49
53};
54
56{
60};
61
63{
64}
65
67{
68}
69
71{
73 return E_FAIL;
74 AppendItemsFromEnumerator(pRegEnumerator);
75 return S_OK;
76}
77
78static LPITEMIDLIST _ILCreateCPanelApplet(LPCWSTR pszName, LPCWSTR pszDisplayName, LPCWSTR pszComment, int iIconIdx)
79{
81 LPITEMIDLIST pidl;
83 int cchName, cchDisplayName, cchComment, cbData;
84
85 /* Calculate lengths of given strings */
86 cchName = wcslen(pszName);
87 cchDisplayName = wcslen(pszDisplayName);
88 cchComment = wcslen(pszComment);
89
90 /* Allocate PIDL */
91 cbData = sizeof(pidl->mkid.cb) + sizeof(pData->type) + sizeof(pData->u.cpanel) - sizeof(pData->u.cpanel.szName)
92 + (cchName + cchDisplayName + cchComment + 3) * sizeof(WCHAR);
93 pidl = (LPITEMIDLIST)SHAlloc(cbData + sizeof(WORD));
94 if (!pidl)
95 return NULL;
96
97 /* Copy data to allocated memory */
98 pidl->mkid.cb = cbData;
99 pData = (PIDLDATA *)pidl->mkid.abID;
100 pData->type = PT_CPLAPPLET;
101
102 pCP = &pData->u.cpanel;
103 pCP->dummy = 0;
104 pCP->iconIdx = iIconIdx;
105 wcscpy(pCP->szName, pszName);
106 pCP->offsDispName = cchName + 1;
107 wcscpy(pCP->szName + pCP->offsDispName, pszDisplayName);
108 pCP->offsComment = pCP->offsDispName + cchDisplayName + 1;
109 wcscpy(pCP->szName + pCP->offsComment, pszComment);
110
111 /* Add PIDL NULL terminator */
112 *(WORD*)(pCP->szName + pCP->offsComment + cchComment + 1) = 0;
113
114 pcheck(pidl);
115
116 return pidl;
117}
118
119/**************************************************************************
120 * _ILGetCPanelPointer()
121 * gets a pointer to the control panel struct stored in the pidl
122 */
124{
126
127 if (pdata && pdata->type == PT_CPLAPPLET)
128 return (PIDLCPanelStruct *) & (pdata->u.cpanel);
129
130 return NULL;
131}
132
134{
136 if (!pData)
137 return E_FAIL;
138
139 CComPtr<IDefaultExtractIconInit> initIcon;
142 return hr;
143
144 initIcon->SetNormalIcon(pData->szName, (int)pData->iconIdx != -1 ? pData->iconIdx : 0);
145
146 return initIcon->QueryInterface(riid, ppvOut);
147}
148
150{
151 CPlApplet* applet = Control_LoadApplet(0, wpath, NULL);
152 int iconIdx;
153
154 if (applet)
155 {
156 for (UINT i = 0; i < applet->count; ++i)
157 {
158 if (applet->info[i].idIcon > 0)
159 iconIdx = -applet->info[i].idIcon; /* negative icon index instead of icon number */
160 else
161 iconIdx = 0;
162
164 applet->info[i].name,
165 applet->info[i].info,
166 iconIdx);
167
168 if (pidl)
169 AddToEnumList(pidl);
170 }
171 Control_UnloadApplet(applet);
172 }
173 return TRUE;
174}
175
177{
180 HKEY hkey;
181
182 int cnt = 0;
183
184 if (RegOpenKeyW(hkey_root, szRepPath, &hkey) == ERROR_SUCCESS)
185 {
186 int idx = 0;
187
188 for(; ; idx++)
189 {
190 DWORD nameLen = MAX_PATH;
191 DWORD valueLen = MAX_PATH;
193
194 if (RegEnumValueW(hkey, idx, name, &nameLen, NULL, NULL, (LPBYTE)&value, &valueLen) != ERROR_SUCCESS)
195 break;
196
198 {
200 }
201
203 ++cnt;
204 }
205 RegCloseKey(hkey);
206 }
207
208 return cnt;
209}
210
211/**************************************************************************
212 * CControlPanelEnum::CreateCPanelEnumList()
213 */
215{
219
220 TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
221
222 /* enumerate the control panel applets */
223 if (dwFlags & SHCONTF_NONFOLDERS)
224 {
225 LPWSTR p;
226
229 wcscpy(p, L"*.cpl");
230
231 hFile = FindFirstFileW(szPath, &wfd);
232
234 {
235 do
236 {
237 if (!(dwFlags & SHCONTF_INCLUDEHIDDEN) && (wfd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN))
238 continue;
239
240 if (!(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
241 wcscpy(p, wfd.cFileName);
242 if (wcscmp(wfd.cFileName, L"ncpa.cpl"))
244 }
245 } while(FindNextFileW(hFile, &wfd));
247 }
248
249 RegisterRegistryCPanelApps(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls");
250 RegisterRegistryCPanelApps(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls");
251 }
252 return TRUE;
253}
254
256{
257 pidlRoot = NULL; /* absolute pidl */
258}
259
261{
262 TRACE("-- destroying IShellFolder(%p)\n", this);
264}
265
266/**************************************************************************
267* CControlPanelFolder::ParseDisplayName
268*/
270 HWND hwndOwner,
271 LPBC pbc,
272 LPOLESTR lpszDisplayName,
273 DWORD *pchEaten,
274 PIDLIST_RELATIVE *ppidl,
275 DWORD *pdwAttributes)
276{
277 /* We only support parsing guid names */
278 return m_regFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl, pdwAttributes);
279}
280
281/**************************************************************************
282* CControlPanelFolder::EnumObjects
283*/
284HRESULT WINAPI CControlPanelFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
285{
286 CComPtr<IEnumIDList> pRegEnumerator;
287 m_regFolder->EnumObjects(hwndOwner, dwFlags, &pRegEnumerator);
288
289 return ShellObjectCreatorInit<CControlPanelEnum>(dwFlags, pRegEnumerator, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
290}
291
292/**************************************************************************
293* CControlPanelFolder::BindToObject
294*/
297 LPBC pbcReserved,
298 REFIID riid,
299 LPVOID *ppvOut)
300{
301 return m_regFolder->BindToObject(pidl, pbcReserved, riid, ppvOut);
302}
303
304/**************************************************************************
305* CControlPanelFolder::BindToStorage
306*/
309 LPBC pbcReserved,
310 REFIID riid,
311 LPVOID *ppvOut)
312{
313 FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", this, pidl, pbcReserved, shdebugstr_guid(&riid), ppvOut);
314
315 *ppvOut = NULL;
316 return E_NOTIMPL;
317}
318
319/**************************************************************************
320* CControlPanelFolder::CompareIDs
321*/
323{
324 /* Dont use SHELL32_CompareGuidItems because it would cause guid items to come first */
325 if (_ILIsSpecialFolder(pidl1) || _ILIsSpecialFolder(pidl2))
326 {
327 return SHELL32_CompareDetails(this, lParam, pidl1, pidl2);
328 }
329 PIDLCPanelStruct *pData1 = _ILGetCPanelPointer(pidl1);
330 PIDLCPanelStruct *pData2 = _ILGetCPanelPointer(pidl2);
331
332 if (!pData1 || !pData2 || LOWORD(lParam) >= CONTROLPANEL_COL_COUNT)
333 return E_INVALIDARG;
334
335 int result;
336 switch(LOWORD(lParam))
337 {
339 result = wcsicmp(pData1->szName + pData1->offsDispName, pData2->szName + pData2->offsDispName);
340 break;
342 result = wcsicmp(pData1->szName + pData1->offsComment, pData2->szName + pData2->offsComment);
343 break;
344 default:
345 ERR("Got wrong lParam!\n");
346 return E_INVALIDARG;
347 }
348
350}
351
352/**************************************************************************
353* CControlPanelFolder::CreateViewObject
354*/
356{
357 CComPtr<IShellView> pShellView;
359
360 TRACE("(%p)->(hwnd=%p,%s,%p)\n", this, hwndOwner, shdebugstr_guid(&riid), ppvOut);
361
362 if (ppvOut) {
363 *ppvOut = NULL;
364
365 if (IsEqualIID(riid, IID_IDropTarget)) {
366 WARN("IDropTarget not implemented\n");
367 hr = E_NOTIMPL;
368 } else if (IsEqualIID(riid, IID_IContextMenu)) {
369 WARN("IContextMenu not implemented\n");
370 hr = E_NOTIMPL;
371 } else if (IsEqualIID(riid, IID_IShellView)) {
372 SFV_CREATE sfvparams = {sizeof(SFV_CREATE), this};
373 hr = SHCreateShellFolderView(&sfvparams, (IShellView**)ppvOut);
374 }
375 }
376 TRACE("--(%p)->(interface=%p)\n", this, ppvOut);
377 return hr;
378}
379
380/**************************************************************************
381* CControlPanelFolder::GetAttributesOf
382*/
384{
385 HRESULT hr = S_OK;
386 static const DWORD dwControlPanelAttributes =
387 SFGAO_HASSUBFOLDER | SFGAO_FOLDER | SFGAO_CANLINK;
388
389 TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
390 this, cidl, apidl, rgfInOut, rgfInOut ? *rgfInOut : 0);
391
392 if (!rgfInOut)
393 return E_INVALIDARG;
394 if (cidl && !apidl)
395 return E_INVALIDARG;
396
397 if (*rgfInOut == 0)
398 *rgfInOut = ~0;
399
400 if (!cidl)
401 {
402 *rgfInOut &= dwControlPanelAttributes;
403 }
404 else
405 {
406 while(cidl > 0 && *apidl)
407 {
408 pdump(*apidl);
409 if (_ILIsCPanelStruct(*apidl))
410 *rgfInOut &= SFGAO_CANLINK;
411 else if (_ILIsSpecialFolder(*apidl))
412 m_regFolder->GetAttributesOf(1, apidl, rgfInOut);
413 else
414 ERR("Got an unkown pidl here!\n");
415 apidl++;
416 cidl--;
417 }
418 }
419 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
420 *rgfInOut &= ~SFGAO_VALIDATE;
421
422 TRACE("-- result=0x%08x\n", *rgfInOut);
423 return hr;
424}
425
426/**************************************************************************
427* CControlPanelFolder::GetUIObjectOf
428*
429* PARAMETERS
430* HWND hwndOwner, //[in ] Parent window for any output
431* UINT cidl, //[in ] array size
432* LPCITEMIDLIST* apidl, //[in ] simple pidl array
433* REFIID riid, //[in ] Requested Interface
434* UINT* prgfInOut, //[ ] reserved
435* LPVOID* ppvObject) //[out] Resulting Interface
436*
437*/
439 UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
440{
441 LPVOID pObj = NULL;
443
444 TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
445 this, hwndOwner, cidl, apidl, shdebugstr_guid(&riid), prgfInOut, ppvOut);
446
447 if (ppvOut) {
448 *ppvOut = NULL;
449
450 if (IsEqualIID(riid, IID_IContextMenu) && (cidl >= 1)) {
451
452 /* HACK: We should use callbacks from CDefaultContextMenu instead of creating one on our own */
453 BOOL bHasCpl = FALSE;
454 for (UINT i = 0; i < cidl; i++)
455 {
456 if(_ILIsCPanelStruct(apidl[i]))
457 {
458 bHasCpl = TRUE;
459 }
460 }
461
462 if (bHasCpl)
463 hr = ShellObjectCreatorInit<CCPLItemMenu>(cidl, apidl, riid, &pObj);
464 else
465 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
466 } else if (IsEqualIID(riid, IID_IDataObject) && (cidl >= 1)) {
467 hr = IDataObject_Constructor(hwndOwner, pidlRoot, apidl, cidl, TRUE, (IDataObject **)&pObj);
468 } else if ((IsEqualIID(riid, IID_IExtractIconA) || IsEqualIID(riid, IID_IExtractIconW)) && (cidl == 1)) {
469 if (_ILGetCPanelPointer(apidl[0]))
470 hr = CCPLExtractIcon_CreateInstance(this, apidl[0], riid, &pObj);
471 else
472 hr = m_regFolder->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, &pObj);
473 } else {
475 }
476
477 if (SUCCEEDED(hr) && !pObj)
479
480 *ppvOut = pObj;
481 }
482 TRACE("(%p)->hr=0x%08x\n", this, hr);
483 return hr;
484}
485
486/**************************************************************************
487* CControlPanelFolder::GetDisplayNameOf
488*/
490{
491 if (!pidl)
492 return S_FALSE;
493
494 PIDLCPanelStruct *pCPanel = _ILGetCPanelPointer(pidl);
495
496 if (pCPanel)
497 {
498 return SHSetStrRet(strRet, pCPanel->szName + pCPanel->offsDispName);
499 }
500 else if (_ILIsSpecialFolder(pidl))
501 {
502 return m_regFolder->GetDisplayNameOf(pidl, dwFlags, strRet);
503 }
504
505 return E_FAIL;
506}
507
508/**************************************************************************
509* CControlPanelFolder::SetNameOf
510* Changes the name of a file object or subfolder, possibly changing its item
511* identifier in the process.
512*
513* PARAMETERS
514* HWND hwndOwner, //[in ] Owner window for output
515* LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
516* LPCOLESTR lpszName, //[in ] the items new display name
517* DWORD dwFlags, //[in ] SHGNO formatting flags
518* LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
519*/
521 LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
522{
523 FIXME("(%p)->(%p,pidl=%p,%s,%u,%p)\n", this, hwndOwner, pidl, debugstr_w(lpName), dwFlags, pPidlOut);
524 return E_FAIL;
525}
526
528{
529 FIXME("(%p)\n", this);
530 return E_NOTIMPL;
531}
532
534{
535 FIXME("(%p)\n", this);
536 return E_NOTIMPL;
537}
538
540{
541 TRACE("(%p)\n", this);
542
543 if (pSort) *pSort = 0;
544 if (pDisplay) *pDisplay = 0;
545 return S_OK;
546}
547
549{
550 TRACE("(%p)\n", this);
551
552 if (!pcsFlags || iColumn >= CONTROLPANEL_COL_COUNT)
553 return E_INVALIDARG;
554 *pcsFlags = ControlPanelSFHeader[iColumn].pcsFlags;
555 return S_OK;
556}
557
559{
560 FIXME("(%p)\n", this);
561 return E_NOTIMPL;
562}
563
565{
566 if (!psd || iColumn >= CONTROLPANEL_COL_COUNT)
567 return E_INVALIDARG;
568
569 if (!pidl)
570 {
571 psd->fmt = ControlPanelSFHeader[iColumn].fmt;
572 psd->cxChar = ControlPanelSFHeader[iColumn].cxChar;
573 return SHSetStrRet(&psd->str, shell32_hInstance, ControlPanelSFHeader[iColumn].colnameid);
574 }
575 else if (_ILIsSpecialFolder(pidl))
576 {
577 return m_regFolder->GetDetailsOf(pidl, iColumn, psd);
578 }
579 else
580 {
581 PIDLCPanelStruct *pCPanel = _ILGetCPanelPointer(pidl);
582
583 if (!pCPanel)
584 return E_FAIL;
585
586 switch(iColumn)
587 {
589 return SHSetStrRet(&psd->str, pCPanel->szName + pCPanel->offsDispName);
591 return SHSetStrRet(&psd->str, pCPanel->szName + pCPanel->offsComment);
592 }
593 }
594
595 return E_FAIL;
596}
597
599{
600 FIXME("(%p)\n", this);
601 return E_NOTIMPL;
602}
603
604/************************************************************************
605 * CControlPanelFolder::GetClassID
606 */
608{
609 TRACE("(%p)\n", this);
610
611 if (!lpClassId)
612 return E_POINTER;
613 *lpClassId = CLSID_ControlPanel;
614
615 return S_OK;
616}
617
618/************************************************************************
619 * CControlPanelFolder::Initialize
620 *
621 * NOTES: it makes no sense to change the pidl
622 */
624{
625 if (pidlRoot)
627
628 pidlRoot = ILClone(pidl);
629
630 /* Create the inner reg folder */
631 HRESULT hr;
632 hr = CRegFolder_CreateInstance(&CLSID_ControlPanel,
633 pidlRoot,
634 L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}",
635 L"ControlPanel",
638 return hr;
639
640 return S_OK;
641}
642
643/**************************************************************************
644 * CControlPanelFolder::GetCurFolder
645 */
647{
648 TRACE("(%p)->(%p)\n", this, pidl);
649
650 if (!pidl)
651 return E_POINTER;
652 *pidl = ILClone(pidlRoot);
653 return S_OK;
654}
655
657{
658 m_apidl = NULL;
659 m_cidl = 0;
660}
661
663{
664 m_cidl = cidl;
665 m_apidl = _ILCopyaPidl(apidl, m_cidl);
666 if (m_cidl && !m_apidl)
667 return E_OUTOFMEMORY;
668
669 return S_OK;
670}
671
673{
675}
676
678 HMENU hMenu,
679 UINT indexMenu,
680 UINT idCmdFirst,
681 UINT idCmdLast,
682 UINT uFlags)
683{
684 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst, MFT_STRING, MAKEINTRESOURCEW(IDS_OPEN), MFS_DEFAULT);
686 _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + 1, MFT_STRING, MAKEINTRESOURCEW(IDS_CREATELINK), MFS_ENABLED);
687
688 return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 2);
689}
690
693
694/**************************************************************************
695* ICPanel_IContextMenu_InvokeCommand()
696*/
698{
699 HRESULT hResult;
700
702 if(!pCPanel)
703 return E_FAIL;
704
705 TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n", this, lpcmi, lpcmi->lpVerb, lpcmi->hwnd);
706
707 if (lpcmi->lpVerb == MAKEINTRESOURCEA(0))
708 {
709 /* Hardcode the command here; Executing a cpl file would be fine but we also need to run things like console.dll */
710 WCHAR wszParams[MAX_PATH];
711 PCWSTR wszFile = L"rundll32.exe";
712 PCWSTR wszFormat = L"shell32.dll,Control_RunDLL %s,%s";
713
714 wsprintfW(wszParams, wszFormat, pCPanel->szName, pCPanel->szName + pCPanel->offsDispName);
715
716 /* Note: we pass the applet name to Control_RunDLL to distinguish between multiple applets in one .cpl file */
717 ShellExecuteW(NULL, NULL, wszFile, wszParams, NULL, 0);
718 }
719 else if (lpcmi->lpVerb == MAKEINTRESOURCEA(1)) //FIXME
720 {
721 CComPtr<IDataObject> pDataObj;
723
724 hResult = SHCreateDataObject(pidl, m_cidl, m_apidl, NULL, IID_PPV_ARG(IDataObject, &pDataObj));
725 if (FAILED(hResult))
726 return hResult;
727
728 SHFree(pidl);
729
730 //FIXME: Use SHCreateLinks
731 CComPtr<IShellFolder> psf;
732 CComPtr<IDropTarget> pDT;
733
734 hResult = SHGetDesktopFolder(&psf);
735 if (FAILED(hResult))
736 return hResult;
737
738 hResult = psf->CreateViewObject(NULL, IID_PPV_ARG(IDropTarget, &pDT));
739 if (FAILED(hResult))
740 return hResult;
741
742 SHSimulateDrop(pDT, pDataObj, MK_CONTROL|MK_SHIFT, NULL, NULL);
743 }
744 return S_OK;
745}
746
747/**************************************************************************
748 * ICPanel_IContextMenu_GetCommandString()
749 *
750 */
752 UINT_PTR idCommand,
753 UINT uFlags,
754 UINT* lpReserved,
755 LPSTR lpszName,
756 UINT uMaxNameLen)
757{
758 TRACE("(%p)->(idcom=%lx flags=%x %p name=%p len=%x)\n", this, idCommand, uFlags, lpReserved, lpszName, uMaxNameLen);
759
760 FIXME("unknown command string\n");
761 return E_FAIL;
762}
763
764/**************************************************************************
765* ICPanel_IContextMenu_HandleMenuMsg()
766*/
768 UINT uMsg,
771{
772 TRACE("ICPanel_IContextMenu_HandleMenuMsg (%p)->(msg=%x wp=%lx lp=%lx)\n", this, uMsg, wParam, lParam);
773
774 return E_NOTIMPL;
775}
static const shvheader ControlPanelSFHeader[]
controlpanel_columns
@ CONTROLPANEL_COL_NAME
@ CONTROLPANEL_COL_COMMENT
@ CONTROLPANEL_COL_COUNT
static PIDLCPanelStruct * _ILGetCPanelPointer(LPCITEMIDLIST pidl)
EXTERN_C void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
Definition: control.c:1050
HRESULT CCPLExtractIcon_CreateInstance(IShellFolder *psf, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
static LPITEMIDLIST _ILCreateCPanelApplet(LPCWSTR pszName, LPCWSTR pszDisplayName, LPCWSTR pszComment, int iIconIdx)
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3931
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
static const DWORD dwControlPanelAttributes
HRESULT WINAPI SHCreateDefaultExtractIcon(REFIID riid, void **ppv)
HRESULT IDataObject_Constructor(HWND hwndOwner, PCIDLIST_ABSOLUTE pMyPidl, PCUIDLIST_RELATIVE_ARRAY apidl, UINT cidl, BOOL bExtendedObject, IDataObject **dataObject)
HRESULT WINAPI SHCreateDataObject(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IDataObject *pdtInner, REFIID riid, void **ppv)
HRESULT CRegFolder_CreateInstance(const GUID *pGuid, LPCITEMIDLIST pidlRoot, LPCWSTR lpszPath, LPCWSTR lpszEnumKeyName, REFIID riid, void **ppv)
Definition: CRegFolder.cpp:789
#define shell32_hInstance
#define IDC_STATIC
Definition: resource.h:4
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define IDS_OPEN
Definition: resource.h:12
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define EXTERN_C
Definition: basetyps.h:12
#define FIXME(fmt,...)
Definition: debug.h:111
#define WARN(fmt,...)
Definition: debug.h:112
#define ERR(fmt,...)
Definition: debug.h:110
#define RegCloseKey(hKey)
Definition: registry.h:47
HRESULT WINAPI Initialize(UINT cidl, PCUITEMID_CHILD_ARRAY apidl)
virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
PITEMID_CHILD * m_apidl
virtual HRESULT WINAPI HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam)
virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen)
BOOL RegisterCPanelApp(LPCWSTR path)
BOOL CreateCPanelEnumList(DWORD dwFlags)
HRESULT WINAPI Initialize(DWORD dwFlags, IEnumIDList *pRegEnumerator)
int RegisterRegistryCPanelApps(HKEY hkey_root, LPCWSTR szRepPath)
virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
virtual HRESULT WINAPI CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
virtual HRESULT WINAPI GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum)
virtual HRESULT WINAPI MapColumnToSCID(UINT column, SHCOLUMNID *pscid)
CComPtr< IShellFolder2 > m_regFolder
virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
virtual HRESULT WINAPI GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags)
virtual HRESULT WINAPI GetClassID(CLSID *lpClassId)
virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid)
virtual HRESULT WINAPI GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
virtual HRESULT WINAPI Initialize(PCIDLIST_ABSOLUTE pidl)
virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
virtual HRESULT WINAPI GetCurFolder(PIDLIST_ABSOLUTE *pidl)
virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
BOOL AddToEnumList(LPITEMIDLIST pidl)
HRESULT AppendItemsFromEnumerator(IEnumIDList *pEnum)
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
void pdump(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:311
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:427
BOOL pcheck(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:349
#define ERROR_SUCCESS
Definition: deptool.c:10
#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
#define IDS_SHV_COLUMN_NAME
Definition: resource.h:74
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3291
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
UINT uFlags
Definition: api.c:59
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
#define wcsicmp
Definition: compat.h:15
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
CPlApplet * Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel *panel)
Definition: control.c:59
void Control_UnloadApplet(CPlApplet *applet)
Definition: control.c:43
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304
BOOL WINAPI SHSimulateDrop(IDropTarget *pDrop, IDataObject *pDataObj, DWORD grfKeyState, PPOINTL lpPt, DWORD *pdwEffect)
Definition: ordinal.c:1821
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:294
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
HINSTANCE hInst
Definition: dxdiag.c:13
static BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint buffer
Definition: glext.h:5915
GLfloat GLfloat p
Definition: glext.h:8902
GLuint64EXT * result
Definition: glext.h:11304
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
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
REFIID riid
Definition: atlbase.h:39
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_w
Definition: kernel32.h:32
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:542
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:562
#define END_COM_MAP()
Definition: atlcom.h:553
LPCWSTR szPath
Definition: env.c:37
static LPOLESTR
Definition: stg_prop.c:27
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
static PROTOCOLDATA * pdata
Definition: protocol.c:158
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
_In_ HANDLE hFile
Definition: mswsock.h:90
unsigned int UINT
Definition: ndis.h:50
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define L(x)
Definition: ntvdm.h:50
interface IBindCtx * LPBC
Definition: objfwd.h:18
const GUID IID_IDataObject
#define LOWORD(l)
Definition: pedump.c:82
PITEMID_CHILD * _ILCopyaPidl(PCUITEMID_CHILD_ARRAY apidlsrc, UINT cidl)
Definition: pidl.c:2663
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2187
void _ILFreeaPidl(LPITEMIDLIST *apidl, UINT cidl)
Definition: pidl.c:2646
LPITEMIDLIST _ILCreateControlPanel(void)
Definition: pidl.c:1631
BOOL _ILIsCPanelStruct(LPCITEMIDLIST pidl)
Definition: pidl.c:1994
#define PT_CPLAPPLET
Definition: pidl.h:86
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:561
HRESULT SHELL32_CompareDetails(IShellFolder2 *isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: shlfolder.cpp:239
void WINAPI _InsertMenuItemW(HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2346
HRESULT hr
Definition: shlfolder.c:183
struct _SFV_CREATE SFV_CREATE
#define IDS_CREATELINK
Definition: shresdef.h:218
#define IDS_SHV_COLUMN_COMMENTS
Definition: shresdef.h:69
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
@ SHCOLSTATE_TYPE_STR
Definition: shtypes.idl:121
@ SHCOLSTATE_ONBYDEFAULT
Definition: shtypes.idl:125
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define TRACE(s)
Definition: solgame.cpp:4
struct applet_info info[1]
Definition: cpanel.h:52
unsigned count
Definition: cpanel.h:49
STRRET str
Definition: shtypes.idl:108
Definition: ftp_var.h:139
Definition: name.c:39
WORD offsComment
Definition: pidl.h:115
WCHAR szName[1]
Definition: pidl.h:116
WORD offsDispName
Definition: pidl.h:114
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
const uint16_t * PCWSTR
Definition: typedefs.h:57
unsigned char * LPBYTE
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
Definition: pdh_main.c:94
static const WCHAR wszFile[]
Definition: urlmon_main.c:386
_In_ LPCSTR lpName
Definition: winbase.h:2776
_In_ LPCSTR _Out_writes_to_opt_ cchDisplayName LPSTR _Inout_ LPDWORD cchDisplayName
Definition: winbase.h:2778
_In_ PSID _Out_writes_to_opt_ cchName LPSTR _Inout_ LPDWORD cchName
Definition: winbase.h:2754
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define E_NOINTERFACE
Definition: winerror.h:2364
#define SEVERITY_SUCCESS
Definition: winerror.h:64
#define E_POINTER
Definition: winerror.h:2365
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define MK_SHIFT
Definition: winuser.h:2359
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define MFT_SEPARATOR
Definition: winuser.h:739
#define MFS_DEFAULT
Definition: winuser.h:743
#define MK_CONTROL
Definition: winuser.h:2360
#define MFS_ENABLED
Definition: winuser.h:745
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
#define MFT_STRING
Definition: winuser.h:741
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
static void Initialize()
Definition: xlate.c:212
#define IID_PPV_ARG(Itype, ppType)
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185