本文整理汇总了C++中ILClone函数的典型用法代码示例。如果您正苦于以下问题:C++ ILClone函数的具体用法?C++ ILClone怎么用?C++ ILClone使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ILClone函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: m_hwnd
CFileContextMenuManager::CFileContextMenuManager(HWND hwnd,
LPITEMIDLIST pidlParent,std::list<LPITEMIDLIST> pidlItemList) :
m_hwnd(hwnd),
m_pidlParent(ILClone(pidlParent)),
m_pShellContext3(NULL),
m_pShellContext2(NULL),
m_pShellContext(NULL)
{
IContextMenu *pContextMenu = NULL;
HRESULT hr;
for each(auto pidl in pidlItemList)
{
m_pidlItemList.push_back(ILClone(pidl));
}
示例2: ILClone
HRESULT WINAPI CRecycleBinItemContextMenu::Initialize(LPCITEMIDLIST pidl)
{
apidl = ILClone(pidl);
if (apidl == NULL)
return E_OUTOFMEMORY;
return S_OK;
}
示例3: CDS_IDLDropTarget_Create
HRESULT CDS_IDLDropTarget_Create(HWND hwndOwner, IDropTargetVtbl *lpVtbl,
LPCITEMIDLIST pidl, LPDROPTARGET *ppdropt)
{
LPIDLDROPTARGET pidldt = (void*)LocalAlloc(LPTR, SIZEOF(CIDLDropTarget));
if (pidldt)
{
pidldt->pidl = ILClone(pidl);
if (pidldt->pidl)
{
pidldt->dropt.lpVtbl = lpVtbl;
pidldt->cRef = 1;
pidldt->hwndOwner = hwndOwner;
Assert(pidldt->pdtgAgr == NULL);
*ppdropt = &pidldt->dropt;
return S_OK;
}
else
LocalFree((HLOCAL)pidldt);
}
*ppdropt = NULL;
return E_OUTOFMEMORY;
}
示例4: SHCreateDefaultContextMenu
HRESULT WINAPI SHCreateDefaultContextMenu(const DEFCONTEXTMENU *pdcm, REFIID riid, void **ppv)
{
IShellFolder *folder=pdcm->psf;
LPITEMIDLIST folder_pidl;
HRESULT ret;
IContextMenu *system_menu;
TRACE("(%p,%s,%p)\n",pdcm,shdebugstr_guid(riid),ppv);
if(!pdcm->pidlFolder)
{
IPersistFolder2 *persist;
IShellFolder_QueryInterface(folder,&IID_IPersistFolder2,(void**)&persist);
IPersistFolder2_GetCurFolder(persist,&folder_pidl);
IPersistFolder2_Release(persist);
}
else
folder_pidl=ILClone(pdcm->pidlFolder);
if(pdcm->cKeys==0)
FIXME("Loading shell extensions using IQueryAssociations not yet supported\n");
ItemMenu_Constructor(folder, folder_pidl, (const LPCITEMIDLIST*)pdcm->apidl, pdcm->cidl, &IID_IContextMenu, (void**)&system_menu);
ret = SHELL_CreateContextMenu(pdcm->hwnd,system_menu,folder,folder_pidl,(LPCITEMIDLIST*)pdcm->apidl,pdcm->cidl,pdcm->aKeys,pdcm->cKeys,riid,ppv);
IContextMenu_Release(system_menu);
ILFree(folder_pidl);
return ret;
}
示例5: IDataObject_Constructor
/**************************************************************************
* IDataObject_Constructor
*/
LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner, LPITEMIDLIST pMyPidl, LPITEMIDLIST * apidl, UINT cidl)
{
IDataObjectImpl* dto;
dto = (IDataObjectImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDataObjectImpl));
if (dto)
{
dto->ref = 1;
ICOM_VTBL(dto) = &dtovt;
dto->pidl = ILClone(pMyPidl);
dto->apidl = _ILCopyaPidl(apidl, cidl);
dto->cidl = cidl;
dto->cfShellIDList = RegisterClipboardFormatA(CFSTR_SHELLIDLIST);
dto->cfFileName = RegisterClipboardFormatA(CFSTR_FILENAMEA);
InitFormatEtc(dto->pFormatEtc[0], dto->cfShellIDList, TYMED_HGLOBAL);
InitFormatEtc(dto->pFormatEtc[1], CF_HDROP, TYMED_HGLOBAL);
InitFormatEtc(dto->pFormatEtc[2], dto->cfFileName, TYMED_HGLOBAL);
shell32_ObjCount++;
}
TRACE("(%p)->(apidl=%p cidl=%u)\n",dto, apidl, cidl);
return (LPDATAOBJECT)dto;
}
示例6: ItemMenu_Constructor
HRESULT ItemMenu_Constructor(IShellFolder *parent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *apidl, UINT cidl,
REFIID riid, void **pObj)
{
ContextMenu* This;
HRESULT hr;
UINT i;
This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
if (!This) return E_OUTOFMEMORY;
This->IContextMenu3_iface.lpVtbl = &ItemContextMenuVtbl;
This->ref = 1;
This->parent = parent;
if (parent) IShellFolder_AddRef(parent);
This->pidl = ILClone(pidl);
This->apidl = _ILCopyaPidl(apidl, cidl);
This->cidl = cidl;
This->allvalues = TRUE;
This->desktop = FALSE;
for (i = 0; i < cidl; i++)
This->allvalues &= (_ILIsValue(apidl[i]) ? 1 : 0);
hr = IContextMenu3_QueryInterface(&This->IContextMenu3_iface, riid, pObj);
IContextMenu3_Release(&This->IContextMenu3_iface);
return hr;
}
示例7: TRACE
/**************************************************************************
* CPrinterFolder::GetCurFolder
*/
HRESULT WINAPI CPrinterFolder::GetCurFolder(LPITEMIDLIST * pidl)
{
TRACE ("(%p)->(%p)\n", this, pidl);
*pidl = ILClone (pidlRoot);
return S_OK;
}
示例8: HeapAlloc
/**************************************************************************
* ISvItemCm_Constructor()
*/
IContextMenu2 *ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *apidl, UINT cidl)
{ ItemCmImpl* cm;
UINT u;
cm = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ItemCmImpl));
cm->IContextMenu2_iface.lpVtbl = &cmvt;
cm->ref = 1;
cm->pidl = ILClone(pidl);
cm->pSFParent = pSFParent;
if(pSFParent) IShellFolder_AddRef(pSFParent);
cm->apidl = _ILCopyaPidl(apidl, cidl);
cm->cidl = cidl;
cm->bAllValues = 1;
for(u = 0; u < cidl; u++)
{
cm->bAllValues &= (_ILIsValue(apidl[u]) ? 1 : 0);
}
TRACE("(%p)->()\n",cm);
return &cm->IContextMenu2_iface;
}
示例9: _ILReadFromSharedMemory
static LPITEMIDLIST _ILReadFromSharedMemory(PCWSTR strField)
{
LPITEMIDLIST ret = NULL;
// Ensure it really is an IDLIST-formatted parameter
// Format for IDLIST params: ":pid:shared"
if (*strField != L':')
return NULL;
HANDLE hData = (HANDLE) StrToIntW(strField + 1);
PWSTR strSecond = StrChrW(strField + 1, L':');
if (strSecond)
{
int pid = StrToIntW(strSecond + 1);
void* pvShared = SHLockShared(hData, pid);
if (pvShared)
{
ret = ILClone((LPCITEMIDLIST) pvShared);
SHUnlockShared(pvShared);
SHFreeShared(hData, pid);
}
}
return ret;
}
示例10: CDefFolderMenu_Create2
HRESULT WINAPI CDefFolderMenu_Create2(LPCITEMIDLIST pidlFolder, HWND hwnd, UINT cidl,
LPCITEMIDLIST *apidl, IShellFolder *psf,
LPFNDFMCALLBACK lpfn, UINT nKeys, const HKEY *ahkeys,
IContextMenu **ppcm)
{
IContextMenu *system_menu;
HRESULT hres;
LPITEMIDLIST folder_pidl;
TRACE("(%p,%p,%u,%p,%p,%u,%p,%p)\n",pidlFolder,hwnd,cidl,apidl,psf,nKeys,ahkeys,ppcm);
if(!pidlFolder)
{
IPersistFolder2 *persist;
IShellFolder_QueryInterface(psf,&IID_IPersistFolder2,(void**)&persist);
IPersistFolder2_GetCurFolder(persist,&folder_pidl);
IPersistFolder2_Release(persist);
}
else
folder_pidl=ILClone(pidlFolder);
ItemMenu_Constructor(psf, folder_pidl, (const LPCITEMIDLIST*)apidl, cidl, &IID_IContextMenu, (void**)&system_menu);
hres= SHELL_CreateContextMenu(hwnd,system_menu,psf,folder_pidl,apidl,cidl,ahkeys,nKeys,&IID_IContextMenu,(void**)ppcm);
IContextMenu_Release(system_menu);
ILFree(folder_pidl);
return hres;
}
示例11: RecycleBin_GetCurFolder
static HRESULT WINAPI RecycleBin_GetCurFolder(IPersistFolder2 *iface, LPITEMIDLIST *ppidl)
{
RecycleBin *This = impl_from_IPersistFolder2(iface);
TRACE("\n");
*ppidl = ILClone(This->pidl);
return S_OK;
}
示例12: SHFree
/************************************************************************
* ISF_NetConnect_PersistFolder2_Initialize
*
* NOTES: it makes no sense to change the pidl
*/
HRESULT WINAPI CNetworkConnections::Initialize(PCIDLIST_ABSOLUTE pidl)
{
SHFree(m_pidlRoot);
m_pidlRoot = ILClone(pidl);
return S_OK;
}
示例13: BrsFolder_OnCommand
static BOOL BrsFolder_OnCommand( browse_info *info, UINT id )
{
LPBROWSEINFOW lpBrowseInfo = info->lpBrowseInfo;
switch (id)
{
case IDOK:
/* The original pidl is owned by the treeview and will be free'd. */
info->pidlRet = ILClone(info->pidlRet);
if (info->pidlRet == NULL) /* A null pidl would mean a cancel */
info->pidlRet = _ILCreateDesktop();
pdump( info->pidlRet );
if (lpBrowseInfo->pszDisplayName)
SHGetPathFromIDListW( info->pidlRet, lpBrowseInfo->pszDisplayName );
EndDialog( info->hWnd, 1 );
return TRUE;
case IDCANCEL:
EndDialog( info->hWnd, 0 );
return TRUE;
case IDD_MAKENEWFOLDER:
FIXME("make new folder not implemented\n");
return TRUE;
}
return FALSE;
}
示例14: ISF_Desktop_IPersistFolder2_fnGetCurFolder
static HRESULT WINAPI ISF_Desktop_IPersistFolder2_fnGetCurFolder(
IPersistFolder2 *iface, LPITEMIDLIST *ppidl)
{
IDesktopFolderImpl *This = impl_from_IPersistFolder2( iface );
*ppidl = ILClone(This->pidlRoot);
return S_OK;
}
示例15: SHFree
/************************************************************************
* ISF_NetConnect_PersistFolder2_Initialize
*
* NOTES: it makes no sense to change the pidl
*/
HRESULT WINAPI CNetworkConnections::Initialize(LPCITEMIDLIST pidl)
{
SHFree(pidlRoot);
pidlRoot = ILClone(pidl);
return S_OK;
}