网站首页  词典首页

请输入您要查询的函数:

 

术语 shbindtoparent
释义 SHBindToParent
语法:
HRESULT SHBindToParent( PCIDLIST_ABSOLUTE pidl,
REFIID riid,
VOID **ppv,
PCUITEMID_CHILD *ppidlLast
);
SHBindToParent功能
时间指向一个完全合格的项目标识符列表(的PIDL),并返回一个父对象指定的接口指针。
参数
的PIDL
[in]该项目的指针的项目标识符列表(的PIDL)。
riid
[in]的由该项目的父对象暴露的接口之一REFIID。
PPV的
[内]一个由riid指定的接口指针。您必须释放当您完成的对象。
ppidlLast
[指出]该项目的的PIDL相对于父文件夹。这的PIDL可用于由父文件夹的接口支持的方法很多。如果您设置ppidlLast为NULL,不返回的PIDL。
注意SHBindToParent不分配一个新的PIDL,它只是接收通过此参数指针。因此,您不负责释放该资源。
返回值
返回S_OK如果成功,或其他错误值。
例如
下面的代码片段使用SHBindToParent检索从一个项目的的PIDL显示名称。该StrRetToBuf函数用于转换STRRET结构IShellFolder返回::成一个字符串GetDisplayNameOf。
// pidlItem is the item's PIDL
// pidlRelative is the item's PIDL relative to the parent folder
IShellFolder* psfParent; /* A pointer to the parent folder object's
IShellFolder interface. */
STRRET str; // The display name's STRRET structure.
TCHAR szDisplayName[MAX_PATH]; // The display name's string.
HRESULT hres = SHBindToParent(pidlItem,
IID_IShellFolder,
(void**) &psfParent,
&pidlRelative);
if(SUCCEEDED(hres))
{
psfParent->GetDisplayNameOf(pidlRelative, SHGDN_NORMAL, &str);
psfParent->Release();
StrRetToBuf(&str,
pidlItem,
szDisplayName,
sizeof(szDisplayName)/sizeof((szDisplayName)[0]));
}

功能信息
最低DLL版本 shell32.dll 5.0或更新版本
自定义ImplementationNo
Headershlobj.h
import libraryshell32.lib
最低经营systemsWindows 2000年,Windows Millennium Edition中
==英文原文==SHBindToParent Function
Takes a pointer to a fully-qualified item identifier list (PIDL), and returns a specified interface pointer on the parent object.
Syntax
HRESULT SHBindToParent( PCIDLIST_ABSOLUTE pidl,
REFIID riid,
VOID **ppv,
PCUITEMID_CHILD *ppidlLast
);
Parameters
pidl
[in] The item's pointer to an item identifier list (PIDL).
riid
[in] The REFIID of one of the interfaces exposed by the item's parent object.
ppv
[out] A pointer to the interface specified by riid. You must release the object when you are finished.
ppidlLast
[out] The item's PIDL relative to the parent folder. This PIDL can be used with many of the methods supported by the parent folder's interfaces. If you set ppidlLast to NULL, the PIDL is not returned.
Note SHBindToParent does not allocate a new PIDL; it simply receives a pointer through this parameter. Therefore, you are not responsible for freeing this resource.
Return Value
Returns S_OK if successful, or an error value otherwise.
Example
The following code fragment uses SHBindToParent to retrieve the display name from an item's PIDL. The StrRetToBuf function is used to convert the STRRET structure returned by IShellFolder::GetDisplayNameOf into a string.
// pidlItem is the item's PIDL
// pidlRelative is the item's PIDL relative to the parent folder
IShellFolder* psfParent; /* A pointer to the parent folder object's
IShellFolder interface. */
STRRET str; // The display name's STRRET structure.
TCHAR szDisplayName[MAX_PATH]; // The display name's string.
HRESULT hres = SHBindToParent(pidlItem,
IID_IShellFolder,
(void**) &psfParent,
&pidlRelative);
if(SUCCEEDED(hres))
{
psfParent->GetDisplayNameOf(pidlRelative, SHGDN_NORMAL, &str);
psfParent->Release();
StrRetToBuf(&str,
pidlItem,
szDisplayName,
sizeof(szDisplayName)/sizeof((szDisplayName)[0]));
}
Function Information
Minimum DLL Versionshell32.dll version 5.0 or later
Custom ImplementationNo
Headershlobj.h
Import libraryshell32.lib
Minimum operating systemsWindows 2000, Windows Millennium Edition
==原始网址==http://msdn.microsoft.com/en-us/library/bb762114(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:17:52