当前位置: 首页>>代码示例>>C++>>正文


C++ IShellItem::GetAttributes方法代码示例

本文整理汇总了C++中IShellItem::GetAttributes方法的典型用法代码示例。如果您正苦于以下问题:C++ IShellItem::GetAttributes方法的具体用法?C++ IShellItem::GetAttributes怎么用?C++ IShellItem::GetAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IShellItem的用法示例。


在下文中一共展示了IShellItem::GetAttributes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PyCom_BuildPyException

// @pymethod int|PyIShellItem|GetAttributes|Returns shell attributes of the item
// @rdesc Returns a combination of shellcon.SFGAO_* values
PyObject *PyIShellItem::GetAttributes(PyObject *self, PyObject *args)
{
	IShellItem *pISI = GetI(self);
	if ( pISI == NULL )
		return NULL;
	SFGAOF sfgaoMask;
	SFGAOF ret;
	// @pyparm int|Mask||Combination of shellcon.SFGAO_* values indicating the flags to return
	if ( !PyArg_ParseTuple(args, "k:GetAttributes", &sfgaoMask) )
		return NULL;
	HRESULT hr;
	PY_INTERFACE_PRECALL;
	hr = pISI->GetAttributes( sfgaoMask, &ret);
	PY_INTERFACE_POSTCALL;

	if ( FAILED(hr) )
		return PyCom_BuildPyException(hr, pISI, IID_IShellItem );
	return PyLong_FromUnsignedLong(ret);
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:21,代码来源:PyIShellItem.cpp

示例2: OnSelectionChange

 IFACEMETHODIMP OnSelectionChange(IFileDialog *pfd)
 {
     // Update the text of the Open/Add button here based on the selection
     IShellItem *psi;
     HRESULT hr = pfd->GetCurrentSelection(&psi);
     if (SUCCEEDED(hr))
     {
         SFGAOF attr;
         hr = psi->GetAttributes(SFGAO_FOLDER | SFGAO_STREAM, &attr);
         if (SUCCEEDED(hr) && (SFGAO_FOLDER == attr))
         {
             pfd->SetOkButtonLabel(L"Open");
         }
         else
         {
             pfd->SetOkButtonLabel(L"Add");
         }
         psi->Release();
     }
     return S_OK;
 }
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:21,代码来源:CommonFileDialogModes.cpp

示例3: getPaths

	void getPaths(IShellItemArray* shellItems, Vector<Path>& paths)
	{
		DWORD numShellItems;
		shellItems->GetCount(&numShellItems);

		for (DWORD i = 0; i < numShellItems; ++i)
		{
			IShellItem* shellItem = nullptr;
			shellItems->GetItemAt(i, &shellItem);

			SFGAOF attribs;
			shellItem->GetAttributes(SFGAO_FILESYSTEM, &attribs);

			if (!(attribs & SFGAO_FILESYSTEM))
				continue;

			LPWSTR name;
			shellItem->GetDisplayName(SIGDN_FILESYSPATH, &name);
			paths.push_back((Path)UTF8::fromWide(WString(name)));
			CoTaskMemFree(name);
		}
	}
开发者ID:fascwind,项目名称:BansheeEngine,代码行数:22,代码来源:BsWin32BrowseDialogs.cpp


注:本文中的IShellItem::GetAttributes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。