4 * Copyright 2003 Martin Fuchs
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.
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.
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
25 WINE_DEFAULT_DEBUG_CHANNEL(shell
);
27 /***********************************************************************
28 * control panel implementation in shell namespace
32 const IShellFolder2Vtbl
*lpVtbl
;
34 const IPersistFolder2Vtbl
*lpVtblPersistFolder2
;
35 const IShellExecuteHookWVtbl
*lpVtblShellExecuteHookW
;
36 const IShellExecuteHookAVtbl
*lpVtblShellExecuteHookA
;
37 const IContextMenu2Vtbl
*lpVtblContextMenu
;
38 IUnknown
*pUnkOuter
; /* used for aggregation */
40 /* both paths are parsible from the desktop */
41 LPITEMIDLIST pidlRoot
; /* absolute pidl */
42 int dwAttributes
; /* attributes returned by GetAttributesOf FIXME: use it */
45 } ICPanelImpl
, *LPICPanelImpl
;
47 static const IShellFolder2Vtbl vt_ShellFolder2
;
48 static const IPersistFolder2Vtbl vt_PersistFolder2
;
49 static const IShellExecuteHookWVtbl vt_ShellExecuteHookW
;
50 static const IShellExecuteHookAVtbl vt_ShellExecuteHookA
;
51 static const IContextMenu2Vtbl vt_ContextMenu
;
53 static LPICPanelImpl __inline
impl_from_IPersistFolder2( IPersistFolder2
*iface
)
55 return (LPICPanelImpl
)((char*)iface
- FIELD_OFFSET(ICPanelImpl
, lpVtblPersistFolder2
));
58 static LPICPanelImpl __inline
impl_from_IContextMenu( IContextMenu2
*iface
)
60 return (LPICPanelImpl
)((char*)iface
- FIELD_OFFSET(ICPanelImpl
, lpVtblContextMenu
));
64 static LPICPanelImpl __inline
impl_from_IShellExecuteHookW( IShellExecuteHookW
*iface
)
66 return (LPICPanelImpl
)((char*)iface
- FIELD_OFFSET(ICPanelImpl
, lpVtblShellExecuteHookW
));
69 static LPICPanelImpl __inline
impl_from_IShellExecuteHookA( IShellExecuteHookA
*iface
)
71 return (LPICPanelImpl
)((char*)iface
- FIELD_OFFSET(ICPanelImpl
, lpVtblShellExecuteHookA
));
76 converts This to an interface pointer
78 #define _IUnknown_(This) (IUnknown*)&(This->lpVtbl)
79 #define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl)
80 #define _IShellFolder2_(This) (IShellFolder2*)&(This->lpVtbl)
82 #define _IPersist_(This) (IPersist*)&(This->lpVtblPersistFolder2)
83 #define _IPersistFolder_(This) (IPersistFolder*)&(This->lpVtblPersistFolder2)
84 #define _IPersistFolder2_(This) (IPersistFolder2*)&(This->lpVtblPersistFolder2)
85 #define _IShellExecuteHookW_(This) (IShellExecuteHookW*)&(This->lpVtblShellExecuteHookW)
86 #define _IShellExecuteHookA_(This) (IShellExecuteHookA*)&(This->lpVtblShellExecuteHookA)
89 /***********************************************************************
90 * IShellFolder [ControlPanel] implementation
93 static const shvheader ControlPanelSFHeader
[] = {
94 {IDS_SHV_COLUMN8
, SHCOLSTATE_TYPE_STR
| SHCOLSTATE_ONBYDEFAULT
, LVCFMT_RIGHT
, 15},/*FIXME*/
95 {IDS_SHV_COLUMN9
, SHCOLSTATE_TYPE_STR
| SHCOLSTATE_ONBYDEFAULT
, LVCFMT_RIGHT
, 200},/*FIXME*/
98 #define CONROLPANELSHELLVIEWCOLUMNS 2
100 /**************************************************************************
101 * IControlPanel_Constructor
103 HRESULT WINAPI
IControlPanel_Constructor(IUnknown
* pUnkOuter
, REFIID riid
, LPVOID
* ppv
)
107 TRACE("unkOut=%p %s\n", pUnkOuter
, shdebugstr_guid(riid
));
111 if (pUnkOuter
&& !IsEqualIID (riid
, &IID_IUnknown
))
112 return CLASS_E_NOAGGREGATION
;
114 sf
= (ICPanelImpl
*) LocalAlloc(LMEM_ZEROINIT
, sizeof(ICPanelImpl
));
116 return E_OUTOFMEMORY
;
121 sf
->lpVtbl
= &vt_ShellFolder2
;
122 sf
->lpVtblPersistFolder2
= &vt_PersistFolder2
;
123 sf
->lpVtblShellExecuteHookW
= &vt_ShellExecuteHookW
;
124 sf
->lpVtblShellExecuteHookA
= &vt_ShellExecuteHookA
;
125 sf
->lpVtblContextMenu
= &vt_ContextMenu
;
126 sf
->pidlRoot
= _ILCreateControlPanel(); /* my qualified pidl */
127 sf
->pUnkOuter
= pUnkOuter
? pUnkOuter
: _IUnknown_ (sf
);
129 if (!SUCCEEDED(IUnknown_QueryInterface(_IUnknown_(sf
), riid
, ppv
))) {
130 IUnknown_Release(_IUnknown_(sf
));
131 return E_NOINTERFACE
;
134 TRACE("--(%p)\n", sf
);
138 /**************************************************************************
139 * ISF_ControlPanel_fnQueryInterface
141 * NOTES supports not IPersist/IPersistFolder
143 static HRESULT WINAPI
ISF_ControlPanel_fnQueryInterface(IShellFolder2
* iface
, REFIID riid
, LPVOID
* ppvObject
)
145 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
147 TRACE("(%p)->(%s,%p)\n", This
, shdebugstr_guid(riid
), ppvObject
);
151 if (IsEqualIID(riid
, &IID_IUnknown
) ||
152 IsEqualIID(riid
, &IID_IShellFolder
) || IsEqualIID(riid
, &IID_IShellFolder2
))
154 else if (IsEqualIID(riid
, &IID_IPersist
) ||
155 IsEqualIID(riid
, &IID_IPersistFolder
) || IsEqualIID(riid
, &IID_IPersistFolder2
))
156 *ppvObject
= _IPersistFolder2_(This
);
157 else if (IsEqualIID(riid
, &IID_IShellExecuteHookW
))
158 *ppvObject
= _IShellExecuteHookW_(This
);
159 else if (IsEqualIID(riid
, &IID_IShellExecuteHookA
))
160 *ppvObject
= _IShellExecuteHookA_(This
);
163 IUnknown_AddRef((IUnknown
*)(*ppvObject
));
164 TRACE("-- Interface:(%p)->(%p)\n", ppvObject
, *ppvObject
);
167 TRACE("-- Interface: E_NOINTERFACE\n");
168 return E_NOINTERFACE
;
171 static ULONG WINAPI
ISF_ControlPanel_fnAddRef(IShellFolder2
* iface
)
173 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
174 ULONG refCount
= InterlockedIncrement(&This
->ref
);
176 TRACE("(%p)->(count=%u)\n", This
, refCount
- 1);
181 static ULONG WINAPI
ISF_ControlPanel_fnRelease(IShellFolder2
* iface
)
183 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
184 ULONG refCount
= InterlockedDecrement(&This
->ref
);
186 TRACE("(%p)->(count=%u)\n", This
, refCount
+ 1);
189 TRACE("-- destroying IShellFolder(%p)\n", This
);
190 SHFree(This
->pidlRoot
);
191 LocalFree((HLOCAL
) This
);
196 /**************************************************************************
197 * ISF_ControlPanel_fnParseDisplayName
199 static HRESULT WINAPI
200 ISF_ControlPanel_fnParseDisplayName(IShellFolder2
* iface
,
203 LPOLESTR lpszDisplayName
,
204 DWORD
* pchEaten
, LPITEMIDLIST
* ppidl
, DWORD
* pdwAttributes
)
206 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
208 HRESULT hr
= E_INVALIDARG
;
210 FIXME("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
211 This
, hwndOwner
, pbc
, lpszDisplayName
, debugstr_w(lpszDisplayName
), pchEaten
, ppidl
, pdwAttributes
);
217 TRACE("(%p)->(-- ret=0x%08x)\n", This
, hr
);
222 static LPITEMIDLIST
_ILCreateCPanelApplet(LPCSTR name
, LPCSTR displayName
,
223 LPCSTR comment
, int iconIdx
)
228 int size0
= (char*)&tmp
.u
.cpanel
.szName
-(char*)&tmp
.u
.cpanel
;
232 tmp
.type
= PT_CPLAPPLET
;
233 tmp
.u
.cpanel
.dummy
= 0;
234 tmp
.u
.cpanel
.iconIdx
= iconIdx
;
239 tmp
.u
.cpanel
.offsDispName
= l
+1;
240 l
= strlen(displayName
);
243 tmp
.u
.cpanel
.offsComment
= tmp
.u
.cpanel
.offsDispName
+1+l
;
247 pidl
= SHAlloc(size
+4);
251 pidl
->mkid
.cb
= size
+2;
252 memcpy(pidl
->mkid
.abID
, &tmp
, 2+size0
);
254 p
= &((PIDLDATA
*)pidl
->mkid
.abID
)->u
.cpanel
;
255 strcpy(p
->szName
, name
);
256 strcpy(p
->szName
+tmp
.u
.cpanel
.offsDispName
, displayName
);
257 strcpy(p
->szName
+tmp
.u
.cpanel
.offsComment
, comment
);
259 *(WORD
*)((char*)pidl
+(size
+2)) = 0;
266 /**************************************************************************
267 * _ILGetCPanelPointer()
268 * gets a pointer to the control panel struct stored in the pidl
270 static PIDLCPanelStruct
* _ILGetCPanelPointer(LPCITEMIDLIST pidl
)
272 LPPIDLDATA pdata
= _ILGetDataPointer(pidl
);
274 if (pdata
&& pdata
->type
==PT_CPLAPPLET
)
275 return (PIDLCPanelStruct
*)&(pdata
->u
.cpanel
);
280 /**************************************************************************
281 * ISF_ControlPanel_fnEnumObjects
283 static BOOL
SHELL_RegisterCPanelApp(IEnumIDList
* list
, LPCSTR path
)
292 char displayName
[MAX_PATH
];
293 char comment
[MAX_PATH
];
295 WCHAR wpath
[MAX_PATH
];
297 MultiByteToWideChar(CP_ACP
, 0, path
, -1, wpath
, MAX_PATH
);
300 applet
= Control_LoadApplet(0, wpath
, &panel
);
304 for(i
=0; i
<applet
->count
; ++i
)
306 WideCharToMultiByte(CP_ACP
, 0, applet
->info
[i
].szName
, -1, displayName
, MAX_PATH
, 0, 0);
307 WideCharToMultiByte(CP_ACP
, 0, applet
->info
[i
].szInfo
, -1, comment
, MAX_PATH
, 0, 0);
309 applet
->proc(0, CPL_INQUIRE
, i
, (LPARAM
)&info
);
312 iconIdx
= -info
.idIcon
; /* negative icon index instead of icon number */
316 pidl
= _ILCreateCPanelApplet(path
, displayName
, comment
, iconIdx
);
319 AddToEnumList(list
, pidl
);
321 Control_UnloadApplet(applet
);
326 static int SHELL_RegisterRegistryCPanelApps(IEnumIDList
* list
, HKEY hkey_root
, LPCSTR szRepPath
)
329 char value
[MAX_PATH
];
334 if (RegOpenKeyA(hkey_root
, szRepPath
, &hkey
) == ERROR_SUCCESS
)
340 DWORD nameLen
= MAX_PATH
;
341 DWORD valueLen
= MAX_PATH
;
343 if (RegEnumValueA(hkey
, idx
, name
, &nameLen
, NULL
, NULL
, (LPBYTE
)&value
, &valueLen
) != ERROR_SUCCESS
)
346 if (SHELL_RegisterCPanelApp(list
, value
))
355 static int SHELL_RegisterCPanelFolders(IEnumIDList
* list
, HKEY hkey_root
, LPCSTR szRepPath
)
362 if (RegOpenKeyA(hkey_root
, szRepPath
, &hkey
) == ERROR_SUCCESS
)
367 if (RegEnumKeyA(hkey
, idx
, name
, MAX_PATH
) != ERROR_SUCCESS
)
372 LPITEMIDLIST pidl
= _ILCreateGuidFromStrA(name
);
374 if (pidl
&& AddToEnumList(list
, pidl
))
385 /**************************************************************************
386 * CreateCPanelEnumList()
388 static BOOL
CreateCPanelEnumList(
392 CHAR szPath
[MAX_PATH
];
393 WIN32_FIND_DATAA wfd
;
396 TRACE("(%p)->(flags=0x%08x)\n", iface
, dwFlags
);
398 /* enumerate control panel folders */
399 if (dwFlags
& SHCONTF_FOLDERS
)
400 SHELL_RegisterCPanelFolders(iface
, HKEY_LOCAL_MACHINE
, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\\NameSpace");
402 /* enumerate the control panel applets */
403 if (dwFlags
& SHCONTF_NONFOLDERS
)
407 GetSystemDirectoryA(szPath
, MAX_PATH
);
408 p
= PathAddBackslashA(szPath
);
411 TRACE("-- (%p)-> enumerate SHCONTF_NONFOLDERS of %s\n",iface
,debugstr_a(szPath
));
412 hFile
= FindFirstFileA(szPath
, &wfd
);
414 if (hFile
!= INVALID_HANDLE_VALUE
)
418 if (!(dwFlags
& SHCONTF_INCLUDEHIDDEN
) && (wfd
.dwFileAttributes
& FILE_ATTRIBUTE_HIDDEN
))
421 if (!(wfd
.dwFileAttributes
& FILE_ATTRIBUTE_DIRECTORY
)) {
422 strcpy(p
, wfd
.cFileName
);
423 if (strcmp(wfd
.cFileName
, "ncpa.cpl"))
424 SHELL_RegisterCPanelApp((IEnumIDList
*)iface
, szPath
);
426 } while(FindNextFileA(hFile
, &wfd
));
430 SHELL_RegisterRegistryCPanelApps((IEnumIDList
*)iface
, HKEY_LOCAL_MACHINE
, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls");
431 SHELL_RegisterRegistryCPanelApps((IEnumIDList
*)iface
, HKEY_CURRENT_USER
, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls");
436 /**************************************************************************
437 * ISF_ControlPanel_fnEnumObjects
439 static HRESULT WINAPI
440 ISF_ControlPanel_fnEnumObjects(IShellFolder2
* iface
, HWND hwndOwner
, DWORD dwFlags
, LPENUMIDLIST
* ppEnumIDList
)
442 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
444 TRACE("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", This
, hwndOwner
, dwFlags
, ppEnumIDList
);
446 *ppEnumIDList
= IEnumIDList_Constructor();
448 CreateCPanelEnumList(*ppEnumIDList
, dwFlags
);
450 TRACE("--(%p)->(new ID List: %p)\n", This
, *ppEnumIDList
);
452 return(*ppEnumIDList
) ? S_OK
: E_OUTOFMEMORY
;
455 /**************************************************************************
456 * ISF_ControlPanel_fnBindToObject
458 static HRESULT WINAPI
459 ISF_ControlPanel_fnBindToObject(IShellFolder2
* iface
, LPCITEMIDLIST pidl
,
460 LPBC pbcReserved
, REFIID riid
, LPVOID
* ppvOut
)
462 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
464 TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", This
, pidl
, pbcReserved
, shdebugstr_guid(riid
), ppvOut
);
466 return SHELL32_BindToChild(This
->pidlRoot
, NULL
, pidl
, riid
, ppvOut
);
469 /**************************************************************************
470 * ISF_ControlPanel_fnBindToStorage
472 static HRESULT WINAPI
473 ISF_ControlPanel_fnBindToStorage(IShellFolder2
* iface
,
474 LPCITEMIDLIST pidl
, LPBC pbcReserved
, REFIID riid
, LPVOID
* ppvOut
)
476 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
478 FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", This
, pidl
, pbcReserved
, shdebugstr_guid(riid
), ppvOut
);
484 /**************************************************************************
485 * ISF_ControlPanel_fnCompareIDs
488 static HRESULT WINAPI
489 ISF_ControlPanel_fnCompareIDs(IShellFolder2
* iface
, LPARAM lParam
, LPCITEMIDLIST pidl1
, LPCITEMIDLIST pidl2
)
491 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
495 TRACE("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This
, lParam
, pidl1
, pidl2
);
496 nReturn
= SHELL32_CompareIDs(_IShellFolder_(This
), lParam
, pidl1
, pidl2
);
497 TRACE("-- %i\n", nReturn
);
501 /**************************************************************************
502 * ISF_ControlPanel_fnCreateViewObject
504 static HRESULT WINAPI
505 ISF_ControlPanel_fnCreateViewObject(IShellFolder2
* iface
, HWND hwndOwner
, REFIID riid
, LPVOID
* ppvOut
)
507 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
509 LPSHELLVIEW pShellView
;
510 HRESULT hr
= E_INVALIDARG
;
512 TRACE("(%p)->(hwnd=%p,%s,%p)\n", This
, hwndOwner
, shdebugstr_guid(riid
), ppvOut
);
517 if (IsEqualIID(riid
, &IID_IDropTarget
)) {
518 WARN("IDropTarget not implemented\n");
520 } else if (IsEqualIID(riid
, &IID_IContextMenu
)) {
521 WARN("IContextMenu not implemented\n");
523 } else if (IsEqualIID(riid
, &IID_IShellView
)) {
524 pShellView
= IShellView_Constructor((IShellFolder
*) iface
);
526 hr
= IShellView_QueryInterface(pShellView
, riid
, ppvOut
);
527 IShellView_Release(pShellView
);
531 TRACE("--(%p)->(interface=%p)\n", This
, ppvOut
);
535 /**************************************************************************
536 * ISF_ControlPanel_fnGetAttributesOf
538 static HRESULT WINAPI
539 ISF_ControlPanel_fnGetAttributesOf(IShellFolder2
* iface
, UINT cidl
, LPCITEMIDLIST
* apidl
, DWORD
* rgfInOut
)
541 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
545 TRACE("(%p)->(cidl=%d apidl=%p mask=%p (0x%08x))\n",
546 This
, cidl
, apidl
, rgfInOut
, rgfInOut
? *rgfInOut
: 0);
556 while(cidl
> 0 && *apidl
) {
558 SHELL32_GetItemAttributes(_IShellFolder_(This
), *apidl
, rgfInOut
);
562 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
563 *rgfInOut
&= ~SFGAO_VALIDATE
;
565 TRACE("-- result=0x%08x\n", *rgfInOut
);
569 /**************************************************************************
570 * ISF_ControlPanel_fnGetUIObjectOf
573 * HWND hwndOwner, //[in ] Parent window for any output
574 * UINT cidl, //[in ] array size
575 * LPCITEMIDLIST* apidl, //[in ] simple pidl array
576 * REFIID riid, //[in ] Requested Interface
577 * UINT* prgfInOut, //[ ] reserved
578 * LPVOID* ppvObject) //[out] Resulting Interface
581 static HRESULT WINAPI
582 ISF_ControlPanel_fnGetUIObjectOf(IShellFolder2
* iface
,
584 UINT cidl
, LPCITEMIDLIST
* apidl
, REFIID riid
, UINT
* prgfInOut
, LPVOID
* ppvOut
)
586 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
589 IUnknown
*pObj
= NULL
;
590 HRESULT hr
= E_INVALIDARG
;
592 TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
593 This
, hwndOwner
, cidl
, apidl
, shdebugstr_guid(riid
), prgfInOut
, ppvOut
);
598 if (IsEqualIID(riid
, &IID_IContextMenu
) &&(cidl
>= 1)) {
600 // create a seperate item struct
602 pObj
= (IUnknown
*)(&This
->lpVtblContextMenu
);
605 IUnknown_AddRef(pObj
);
607 } else if (IsEqualIID(riid
, &IID_IDataObject
) &&(cidl
>= 1)) {
608 pObj
= (LPUNKNOWN
) IDataObject_Constructor(hwndOwner
, This
->pidlRoot
, apidl
, cidl
);
610 } else if (IsEqualIID(riid
, &IID_IExtractIconA
) &&(cidl
== 1)) {
611 pidl
= ILCombine(This
->pidlRoot
, apidl
[0]);
612 pObj
= (LPUNKNOWN
) IExtractIconA_Constructor(pidl
);
615 } else if (IsEqualIID(riid
, &IID_IExtractIconW
) &&(cidl
== 1)) {
616 pidl
= ILCombine(This
->pidlRoot
, apidl
[0]);
617 pObj
= (LPUNKNOWN
) IExtractIconW_Constructor(pidl
);
620 } else if ((IsEqualIID(riid
,&IID_IShellLinkW
) || IsEqualIID(riid
,&IID_IShellLinkA
))
622 pidl
= ILCombine(This
->pidlRoot
, apidl
[0]);
623 hr
= IShellLink_ConstructFromFile(NULL
, riid
, pidl
,(LPVOID
*)&pObj
);
629 if (SUCCEEDED(hr
) && !pObj
)
634 TRACE("(%p)->hr=0x%08x\n", This
, hr
);
638 /**************************************************************************
639 * ISF_ControlPanel_fnGetDisplayNameOf
641 static HRESULT WINAPI
ISF_ControlPanel_fnGetDisplayNameOf(IShellFolder2
* iface
, LPCITEMIDLIST pidl
, DWORD dwFlags
, LPSTRRET strRet
)
643 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
645 CHAR szPath
[MAX_PATH
];
646 WCHAR wszPath
[MAX_PATH
+1]; /* +1 for potential backslash */
647 PIDLCPanelStruct
* pcpanel
;
651 TRACE("(%p)->(pidl=%p,0x%08x,%p)\n", This
, pidl
, dwFlags
, strRet
);
654 if (!pidl
|| !strRet
)
657 pcpanel
= _ILGetCPanelPointer(pidl
);
660 lstrcpyA(szPath
, pcpanel
->szName
+pcpanel
->offsDispName
);
662 if (!(dwFlags
& SHGDN_FORPARSING
))
663 FIXME("retrieve display name from control panel app\n");
665 /* take names of special folders only if it's only this folder */
666 else if (_ILIsSpecialFolder(pidl
)) {
667 BOOL bSimplePidl
= _ILIsPidlSimple(pidl
);
670 _ILSimpleGetTextW(pidl
, wszPath
, MAX_PATH
); /* append my own path */
672 FIXME("special pidl\n");
675 if ((dwFlags
& SHGDN_FORPARSING
) && !bSimplePidl
) { /* go deeper if needed */
678 PathAddBackslashW(wszPath
);
679 len
= wcslen(wszPath
);
682 (SHELL32_GetDisplayNameOfChild(iface
, pidl
, dwFlags
, wszPath
+ len
, MAX_PATH
+ 1 - len
)))
683 return E_OUTOFMEMORY
;
684 if (!WideCharToMultiByte(CP_ACP
, 0, wszPath
, -1, szPath
, MAX_PATH
, NULL
, NULL
))
688 if (!WideCharToMultiByte(CP_ACP
, 0, wszPath
, -1, szPath
, MAX_PATH
, NULL
, NULL
))
694 strRet
->uType
= STRRET_CSTR
;
695 lstrcpynA(strRet
->u
.cStr
, szPath
, MAX_PATH
);
697 TRACE("--(%p)->(%s)\n", This
, szPath
);
701 /**************************************************************************
702 * ISF_ControlPanel_fnSetNameOf
703 * Changes the name of a file object or subfolder, possibly changing its item
704 * identifier in the process.
707 * HWND hwndOwner, //[in ] Owner window for output
708 * LPCITEMIDLIST pidl, //[in ] simple pidl of item to change
709 * LPCOLESTR lpszName, //[in ] the items new display name
710 * DWORD dwFlags, //[in ] SHGNO formatting flags
711 * LPITEMIDLIST* ppidlOut) //[out] simple pidl returned
713 static HRESULT WINAPI
ISF_ControlPanel_fnSetNameOf(IShellFolder2
* iface
, HWND hwndOwner
, LPCITEMIDLIST pidl
, /*simple pidl */
714 LPCOLESTR lpName
, DWORD dwFlags
, LPITEMIDLIST
* pPidlOut
)
716 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
717 FIXME("(%p)->(%p,pidl=%p,%s,%u,%p)\n", This
, hwndOwner
, pidl
, debugstr_w(lpName
), dwFlags
, pPidlOut
);
721 static HRESULT WINAPI
ISF_ControlPanel_fnGetDefaultSearchGUID(IShellFolder2
* iface
, GUID
* pguid
)
723 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
724 FIXME("(%p)\n", This
);
727 static HRESULT WINAPI
ISF_ControlPanel_fnEnumSearches(IShellFolder2
* iface
, IEnumExtraSearch
** ppenum
)
729 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
730 FIXME("(%p)\n", This
);
733 static HRESULT WINAPI
ISF_ControlPanel_fnGetDefaultColumn(IShellFolder2
* iface
, DWORD dwRes
, ULONG
* pSort
, ULONG
* pDisplay
)
735 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
737 TRACE("(%p)\n", This
);
739 if (pSort
) *pSort
= 0;
740 if (pDisplay
) *pDisplay
= 0;
743 static HRESULT WINAPI
ISF_ControlPanel_fnGetDefaultColumnState(IShellFolder2
* iface
, UINT iColumn
, DWORD
* pcsFlags
)
745 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
747 TRACE("(%p)\n", This
);
749 if (!pcsFlags
|| iColumn
>= CONROLPANELSHELLVIEWCOLUMNS
) return E_INVALIDARG
;
750 *pcsFlags
= ControlPanelSFHeader
[iColumn
].pcsFlags
;
753 static HRESULT WINAPI
ISF_ControlPanel_fnGetDetailsEx(IShellFolder2
* iface
, LPCITEMIDLIST pidl
, const SHCOLUMNID
* pscid
, VARIANT
* pv
)
755 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
756 FIXME("(%p)\n", This
);
760 static HRESULT WINAPI
ISF_ControlPanel_fnGetDetailsOf(IShellFolder2
* iface
, LPCITEMIDLIST pidl
, UINT iColumn
, SHELLDETAILS
* psd
)
762 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
765 TRACE("(%p)->(%p %i %p)\n", This
, pidl
, iColumn
, psd
);
767 if (!psd
|| iColumn
>= CONROLPANELSHELLVIEWCOLUMNS
)
771 psd
->fmt
= ControlPanelSFHeader
[iColumn
].fmt
;
772 psd
->cxChar
= ControlPanelSFHeader
[iColumn
].cxChar
;
773 psd
->str
.uType
= STRRET_CSTR
;
774 LoadStringA(shell32_hInstance
, ControlPanelSFHeader
[iColumn
].colnameid
, psd
->str
.u
.cStr
, MAX_PATH
);
777 psd
->str
.u
.cStr
[0] = 0x00;
778 psd
->str
.uType
= STRRET_CSTR
;
781 hr
= IShellFolder_GetDisplayNameOf(iface
, pidl
, SHGDN_NORMAL
| SHGDN_INFOLDER
, &psd
->str
);
783 case 1: /* comment */
784 _ILGetFileType(pidl
, psd
->str
.u
.cStr
, MAX_PATH
);
792 static HRESULT WINAPI
ISF_ControlPanel_fnMapColumnToSCID(IShellFolder2
* iface
, UINT column
, SHCOLUMNID
* pscid
)
794 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
795 FIXME("(%p)\n", This
);
799 static const IShellFolder2Vtbl vt_ShellFolder2
=
802 ISF_ControlPanel_fnQueryInterface
,
803 ISF_ControlPanel_fnAddRef
,
804 ISF_ControlPanel_fnRelease
,
805 ISF_ControlPanel_fnParseDisplayName
,
806 ISF_ControlPanel_fnEnumObjects
,
807 ISF_ControlPanel_fnBindToObject
,
808 ISF_ControlPanel_fnBindToStorage
,
809 ISF_ControlPanel_fnCompareIDs
,
810 ISF_ControlPanel_fnCreateViewObject
,
811 ISF_ControlPanel_fnGetAttributesOf
,
812 ISF_ControlPanel_fnGetUIObjectOf
,
813 ISF_ControlPanel_fnGetDisplayNameOf
,
814 ISF_ControlPanel_fnSetNameOf
,
817 ISF_ControlPanel_fnGetDefaultSearchGUID
,
818 ISF_ControlPanel_fnEnumSearches
,
819 ISF_ControlPanel_fnGetDefaultColumn
,
820 ISF_ControlPanel_fnGetDefaultColumnState
,
821 ISF_ControlPanel_fnGetDetailsEx
,
822 ISF_ControlPanel_fnGetDetailsOf
,
823 ISF_ControlPanel_fnMapColumnToSCID
826 /************************************************************************
827 * ICPanel_PersistFolder2_QueryInterface
829 static HRESULT WINAPI
ICPanel_PersistFolder2_QueryInterface(IPersistFolder2
* iface
, REFIID iid
, LPVOID
* ppvObject
)
831 ICPanelImpl
*This
= impl_from_IPersistFolder2(iface
);
833 TRACE("(%p)\n", This
);
835 return IUnknown_QueryInterface(_IUnknown_(This
), iid
, ppvObject
);
838 /************************************************************************
839 * ICPanel_PersistFolder2_AddRef
841 static ULONG WINAPI
ICPanel_PersistFolder2_AddRef(IPersistFolder2
* iface
)
843 ICPanelImpl
*This
= impl_from_IPersistFolder2(iface
);
845 TRACE("(%p)->(count=%u)\n", This
, This
->ref
);
847 return IUnknown_AddRef(_IUnknown_(This
));
850 /************************************************************************
851 * ISFPersistFolder_Release
853 static ULONG WINAPI
ICPanel_PersistFolder2_Release(IPersistFolder2
* iface
)
855 ICPanelImpl
*This
= impl_from_IPersistFolder2(iface
);
857 TRACE("(%p)->(count=%u)\n", This
, This
->ref
);
859 return IUnknown_Release(_IUnknown_(This
));
862 /************************************************************************
863 * ICPanel_PersistFolder2_GetClassID
865 static HRESULT WINAPI
ICPanel_PersistFolder2_GetClassID(IPersistFolder2
* iface
, CLSID
* lpClassId
)
867 ICPanelImpl
*This
= impl_from_IPersistFolder2(iface
);
869 TRACE("(%p)\n", This
);
873 *lpClassId
= CLSID_ControlPanel
;
878 /************************************************************************
879 * ICPanel_PersistFolder2_Initialize
881 * NOTES: it makes no sense to change the pidl
883 static HRESULT WINAPI
ICPanel_PersistFolder2_Initialize(IPersistFolder2
* iface
, LPCITEMIDLIST pidl
)
885 ICPanelImpl
*This
= impl_from_IPersistFolder2(iface
);
887 SHFree((LPVOID
)This
->pidlRoot
);
889 This
->pidlRoot
= ILClone(pidl
);
893 /**************************************************************************
894 * IPersistFolder2_fnGetCurFolder
896 static HRESULT WINAPI
ICPanel_PersistFolder2_GetCurFolder(IPersistFolder2
* iface
, LPITEMIDLIST
* pidl
)
898 ICPanelImpl
*This
= impl_from_IPersistFolder2(iface
);
900 TRACE("(%p)->(%p)\n", This
, pidl
);
904 *pidl
= ILClone(This
->pidlRoot
);
908 static const IPersistFolder2Vtbl vt_PersistFolder2
=
911 ICPanel_PersistFolder2_QueryInterface
,
912 ICPanel_PersistFolder2_AddRef
,
913 ICPanel_PersistFolder2_Release
,
914 ICPanel_PersistFolder2_GetClassID
,
915 ICPanel_PersistFolder2_Initialize
,
916 ICPanel_PersistFolder2_GetCurFolder
919 HRESULT
CPanel_GetIconLocationW(LPCITEMIDLIST pidl
,
920 LPWSTR szIconFile
, UINT cchMax
, int* piIndex
)
922 PIDLCPanelStruct
* pcpanel
= _ILGetCPanelPointer(pidl
);
927 MultiByteToWideChar(CP_ACP
, 0, pcpanel
->szName
, -1, szIconFile
, cchMax
);
928 *piIndex
= pcpanel
->iconIdx
!=-1? pcpanel
->iconIdx
: 0;
934 /**************************************************************************
935 * IShellExecuteHookW Implementation
938 static HRESULT WINAPI
IShellExecuteHookW_fnQueryInterface(
939 IShellExecuteHookW
* iface
, REFIID riid
, void** ppvObject
)
941 ICPanelImpl
*This
= impl_from_IShellExecuteHookW(iface
);
943 TRACE("(%p)->(count=%u)\n", This
, This
->ref
);
945 return IUnknown_QueryInterface(This
->pUnkOuter
, riid
, ppvObject
);
948 static ULONG STDMETHODCALLTYPE
IShellExecuteHookW_fnAddRef(IShellExecuteHookW
* iface
)
950 ICPanelImpl
*This
= impl_from_IShellExecuteHookW(iface
);
952 TRACE("(%p)->(count=%u)\n", This
, This
->ref
);
954 return IUnknown_AddRef(This
->pUnkOuter
);
957 static ULONG STDMETHODCALLTYPE
IShellExecuteHookW_fnRelease(IShellExecuteHookW
* iface
)
959 ICPanelImpl
*This
= impl_from_IShellExecuteHookW(iface
);
961 TRACE("(%p)\n", This
);
963 return IUnknown_Release(This
->pUnkOuter
);
967 ExecuteAppletFromCLSID(LPOLESTR pOleStr
)
969 WCHAR szCmd
[MAX_PATH
];
970 WCHAR szExpCmd
[MAX_PATH
];
971 PROCESS_INFORMATION pi
;
973 WCHAR szBuffer
[90] = { 'C', 'L', 'S', 'I', 'D', '\\', 0 };
974 DWORD dwType
, dwSize
;
976 wcscpy(&szBuffer
[6], pOleStr
);
977 wcscat(szBuffer
, L
"\\shell\\open\\command");
979 dwSize
= sizeof(szCmd
);
980 if (RegGetValueW(HKEY_CLASSES_ROOT
, szBuffer
, NULL
, RRF_RT_REG_SZ
, &dwType
, (PVOID
)szCmd
, &dwSize
) != ERROR_SUCCESS
)
982 ERR("RegGetValueW failed with %u\n", GetLastError());
987 if (dwType
!= RRF_RT_REG_SZ
&& dwType
!= RRF_RT_REG_EXPAND_SZ
)
991 if (!ExpandEnvironmentStringsW(szCmd
, szExpCmd
, sizeof(szExpCmd
)/sizeof(WCHAR
)))
994 ZeroMemory(&si
, sizeof(si
));
996 if (!CreateProcessW(NULL
, szExpCmd
, NULL
, NULL
, FALSE
, 0, NULL
, NULL
, &si
, &pi
))
999 CloseHandle(pi
.hProcess
);
1000 CloseHandle(pi
.hThread
);
1005 static HRESULT WINAPI
IShellExecuteHookW_fnExecute(IShellExecuteHookW
* iface
, LPSHELLEXECUTEINFOW psei
)
1007 static const WCHAR wCplopen
[] = {'c','p','l','o','p','e','n','\0'};
1008 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
1010 SHELLEXECUTEINFOW sei_tmp
;
1011 PIDLCPanelStruct
* pcpanel
;
1012 WCHAR path
[MAX_PATH
];
1013 WCHAR params
[MAX_PATH
];
1018 TRACE("(%p)->execute(%p)\n", This
, psei
);
1021 return E_INVALIDARG
;
1023 pcpanel
= _ILGetCPanelPointer(ILFindLastID(psei
->lpIDList
));
1029 IID
* iid
= _ILGetGUIDPointer(ILFindLastID(psei
->lpIDList
));
1031 return E_INVALIDARG
;
1032 if (StringFromCLSID(iid
, &pOleStr
) == S_OK
)
1035 hr
= ExecuteAppletFromCLSID(pOleStr
);
1036 CoTaskMemFree(pOleStr
);
1040 return E_INVALIDARG
;
1043 /* Return value from MultiByteToWideChar includes terminating NUL, which
1044 * compensates for the starting double quote we just put in */
1045 l
= MultiByteToWideChar(CP_ACP
, 0, pcpanel
->szName
, -1, path
+1, MAX_PATH
);
1047 /* pass applet name to Control_RunDLL to distinguish between applets in one .cpl file */
1051 MultiByteToWideChar(CP_ACP
, 0, pcpanel
->szName
+pcpanel
->offsDispName
, -1, params
, MAX_PATH
);
1053 memcpy(&sei_tmp
, psei
, sizeof(sei_tmp
));
1054 sei_tmp
.lpFile
= path
;
1055 sei_tmp
.lpParameters
= params
;
1056 sei_tmp
.fMask
&= ~SEE_MASK_INVOKEIDLIST
;
1057 sei_tmp
.lpVerb
= wCplopen
;
1059 ret
= ShellExecuteExW(&sei_tmp
);
1066 static const IShellExecuteHookWVtbl vt_ShellExecuteHookW
=
1069 IShellExecuteHookW_fnQueryInterface
,
1070 IShellExecuteHookW_fnAddRef
,
1071 IShellExecuteHookW_fnRelease
,
1073 IShellExecuteHookW_fnExecute
1077 /**************************************************************************
1078 * IShellExecuteHookA Implementation
1081 static HRESULT WINAPI
IShellExecuteHookA_fnQueryInterface(IShellExecuteHookA
* iface
, REFIID riid
, void** ppvObject
)
1083 ICPanelImpl
*This
= impl_from_IShellExecuteHookA(iface
);
1085 TRACE("(%p)->(count=%u)\n", This
, This
->ref
);
1087 return IUnknown_QueryInterface(This
->pUnkOuter
, riid
, ppvObject
);
1090 static ULONG STDMETHODCALLTYPE
IShellExecuteHookA_fnAddRef(IShellExecuteHookA
* iface
)
1092 ICPanelImpl
*This
= impl_from_IShellExecuteHookA(iface
);
1094 TRACE("(%p)->(count=%u)\n", This
, This
->ref
);
1096 return IUnknown_AddRef(This
->pUnkOuter
);
1099 static ULONG STDMETHODCALLTYPE
IShellExecuteHookA_fnRelease(IShellExecuteHookA
* iface
)
1101 ICPanelImpl
*This
= impl_from_IShellExecuteHookA(iface
);
1103 TRACE("(%p)\n", This
);
1105 return IUnknown_Release(This
->pUnkOuter
);
1108 static HRESULT WINAPI
IShellExecuteHookA_fnExecute(IShellExecuteHookA
* iface
, LPSHELLEXECUTEINFOA psei
)
1110 ICPanelImpl
*This
= (ICPanelImpl
*)iface
;
1112 SHELLEXECUTEINFOA sei_tmp
;
1113 PIDLCPanelStruct
* pcpanel
;
1114 char path
[MAX_PATH
];
1117 TRACE("(%p)->execute(%p)\n", This
, psei
);
1120 return E_INVALIDARG
;
1122 pcpanel
= _ILGetCPanelPointer(ILFindLastID(psei
->lpIDList
));
1125 return E_INVALIDARG
;
1128 lstrcpyA(path
+1, pcpanel
->szName
);
1130 /* pass applet name to Control_RunDLL to distinguish between applets in one .cpl file */
1131 lstrcatA(path
, "\" ");
1132 lstrcatA(path
, pcpanel
->szName
+pcpanel
->offsDispName
);
1134 memcpy(&sei_tmp
, psei
, sizeof(sei_tmp
));
1135 sei_tmp
.lpFile
= path
;
1136 sei_tmp
.fMask
&= ~SEE_MASK_INVOKEIDLIST
;
1138 ret
= ShellExecuteExA(&sei_tmp
);
1145 static const IShellExecuteHookAVtbl vt_ShellExecuteHookA
=
1147 IShellExecuteHookA_fnQueryInterface
,
1148 IShellExecuteHookA_fnAddRef
,
1149 IShellExecuteHookA_fnRelease
,
1150 IShellExecuteHookA_fnExecute
1153 /**************************************************************************
1154 * IContextMenu2 Implementation
1157 /************************************************************************
1158 * ICPanel_IContextMenu_QueryInterface
1160 static HRESULT WINAPI
ICPanel_IContextMenu2_QueryInterface(IContextMenu2
* iface
, REFIID iid
, LPVOID
* ppvObject
)
1162 ICPanelImpl
*This
= impl_from_IContextMenu(iface
);
1164 TRACE("(%p)\n", This
);
1166 return IUnknown_QueryInterface(_IUnknown_(This
), iid
, ppvObject
);
1169 /************************************************************************
1170 * ICPanel_IContextMenu_AddRef
1172 static ULONG WINAPI
ICPanel_IContextMenu2_AddRef(IContextMenu2
* iface
)
1174 ICPanelImpl
*This
= impl_from_IContextMenu(iface
);
1176 TRACE("(%p)->(count=%u)\n", This
, This
->ref
);
1178 return IUnknown_AddRef(_IUnknown_(This
));
1181 /************************************************************************
1182 * ICPanel_IContextMenu_Release
1184 static ULONG WINAPI
ICPanel_IContextMenu2_Release(IContextMenu2
* iface
)
1186 ICPanelImpl
*This
= impl_from_IContextMenu(iface
);
1188 TRACE("(%p)->(count=%u)\n", This
, This
->ref
);
1190 return IUnknown_Release(_IUnknown_(This
));
1193 /**************************************************************************
1194 * ICPanel_IContextMenu_QueryContextMenu()
1196 static HRESULT WINAPI
ICPanel_IContextMenu2_QueryContextMenu(
1197 IContextMenu2
*iface
,
1204 WCHAR szBuffer
[30] = {0};
1207 ICPanelImpl
*This
= impl_from_IContextMenu(iface
);
1209 TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n",
1210 This
, hMenu
, indexMenu
, idCmdFirst
, idCmdLast
, uFlags
);
1212 if (LoadStringW(shell32_hInstance
, IDS_OPEN
, szBuffer
, sizeof(szBuffer
)/sizeof(WCHAR
)))
1214 szBuffer
[(sizeof(szBuffer
)/sizeof(WCHAR
))-1] = L
'\0';
1215 _InsertMenuItemW(hMenu
, indexMenu
++, TRUE
, IDS_OPEN
, MFT_STRING
, szBuffer
, MFS_DEFAULT
); //FIXME identifier
1219 if (LoadStringW(shell32_hInstance
, IDS_CREATELINK
, szBuffer
, sizeof(szBuffer
)/sizeof(WCHAR
)))
1223 _InsertMenuItemW(hMenu
, indexMenu
++, TRUE
, idCmdFirst
+ Count
, MFT_SEPARATOR
, NULL
, MFS_ENABLED
);
1225 szBuffer
[(sizeof(szBuffer
)/sizeof(WCHAR
))-1] = L
'\0';
1227 _InsertMenuItemW(hMenu
, indexMenu
++, TRUE
, IDS_CREATELINK
, MFT_STRING
, szBuffer
, MFS_ENABLED
); //FIXME identifier
1230 return MAKE_HRESULT(SEVERITY_SUCCESS
, 0, Count
);
1234 /**************************************************************************
1235 * ICPanel_IContextMenu_InvokeCommand()
1237 static HRESULT WINAPI
ICPanel_IContextMenu2_InvokeCommand(
1238 IContextMenu2
*iface
,
1239 LPCMINVOKECOMMANDINFO lpcmi
)
1241 SHELLEXECUTEINFOW sei
;
1242 WCHAR szPath
[MAX_PATH
];
1243 char szTarget
[MAX_PATH
];
1246 INT Length
, cLength
;
1247 PIDLCPanelStruct
*pcpanel
;
1250 ICPanelImpl
*This
= impl_from_IContextMenu(iface
);
1252 TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",This
,lpcmi
,lpcmi
->lpVerb
, lpcmi
->hwnd
);
1254 if (lpcmi
->lpVerb
== MAKEINTRESOURCEA(IDS_OPEN
)) //FIXME
1256 ZeroMemory(&sei
, sizeof(sei
));
1257 sei
.cbSize
= sizeof(sei
);
1258 sei
.fMask
= SEE_MASK_INVOKEIDLIST
;
1259 sei
.lpIDList
= ILCombine(This
->pidlRoot
, This
->apidl
[0]);
1260 sei
.hwnd
= lpcmi
->hwnd
;
1261 sei
.nShow
= SW_SHOWNORMAL
;
1262 sei
.lpVerb
= L
"open";
1263 ShellExecuteExW(&sei
);
1264 if (sei
.hInstApp
<= (HINSTANCE
)32)
1267 else if (lpcmi
->lpVerb
== MAKEINTRESOURCEA(IDS_CREATELINK
)) //FIXME
1269 if (!SHGetSpecialFolderPathW(NULL
, szPath
, CSIDL_DESKTOPDIRECTORY
, FALSE
))
1272 pszPath
= PathAddBackslashW(szPath
);
1276 if (IShellFolder_GetDisplayNameOf((IShellFolder
*)This
, This
->apidl
[0], SHGDN_FORPARSING
, &strret
) != S_OK
)
1279 Length
= MAX_PATH
- (pszPath
- szPath
);
1280 cLength
= strlen(strret
.u
.cStr
);
1281 if (Length
< cLength
+ 5)
1287 if (MultiByteToWideChar(CP_ACP
, 0, strret
.u
.cStr
, cLength
+1, pszPath
, Length
))
1295 wcscpy(pszPath
, L
" - ");
1296 cLength
= LoadStringW(shell32_hInstance
, IDS_LNK_FILE
, &pszPath
[3], Length
-4) + 3;
1297 if (cLength
+ 5 > Length
)
1298 cLength
= Length
- 5;
1302 wcscpy(pszPath
, L
".lnk");
1304 pcpanel
= _ILGetCPanelPointer(ILFindLastID(This
->apidl
[0]));
1307 strncpy(szTarget
, pcpanel
->szName
, MAX_PATH
);
1314 if (SUCCEEDED(IShellLink_Constructor(NULL
, &IID_IShellLinkA
, (LPVOID
*)&isl
)))
1316 IShellLinkA_SetPath(isl
, szTarget
);
1317 if (SUCCEEDED(IShellLinkA_QueryInterface(isl
, &IID_IPersistFile
, (LPVOID
*)&ppf
)))
1319 IPersistFile_Save(ppf
, szPath
, TRUE
);
1320 IPersistFile_Release(ppf
);
1322 IShellLinkA_Release(isl
);
1329 /**************************************************************************
1330 * ICPanel_IContextMenu_GetCommandString()
1333 static HRESULT WINAPI
ICPanel_IContextMenu2_GetCommandString(
1334 IContextMenu2
*iface
,
1341 ICPanelImpl
*This
= impl_from_IContextMenu(iface
);
1343 TRACE("(%p)->(idcom=%lx flags=%x %p name=%p len=%x)\n",This
, idCommand
, uFlags
, lpReserved
, lpszName
, uMaxNameLen
);
1346 FIXME("unknown command string\n");
1352 /**************************************************************************
1353 * ICPanel_IContextMenu_HandleMenuMsg()
1355 static HRESULT WINAPI
ICPanel_IContextMenu2_HandleMenuMsg(
1356 IContextMenu2
*iface
,
1361 ICPanelImpl
*This
= impl_from_IContextMenu(iface
);
1363 TRACE("ICPanel_IContextMenu_HandleMenuMsg (%p)->(msg=%x wp=%lx lp=%lx)\n",This
, uMsg
, wParam
, lParam
);
1368 static const IContextMenu2Vtbl vt_ContextMenu
=
1370 ICPanel_IContextMenu2_QueryInterface
,
1371 ICPanel_IContextMenu2_AddRef
,
1372 ICPanel_IContextMenu2_Release
,
1373 ICPanel_IContextMenu2_QueryContextMenu
,
1374 ICPanel_IContextMenu2_InvokeCommand
,
1375 ICPanel_IContextMenu2_GetCommandString
,
1376 ICPanel_IContextMenu2_HandleMenuMsg