Example #1
0
int CALLBACK CShellBrowser::SortByName(const BasicItemInfo_t &itemInfo1, const BasicItemInfo_t &itemInfo2, const GlobalFolderSettings &globalFolderSettings) const
{
	if(m_bVirtualFolder)
	{
		BOOL IsRoot1 = PathIsRoot(itemInfo1.getFullPath().c_str());
		BOOL IsRoot2 = PathIsRoot(itemInfo2.getFullPath().c_str());

		if(IsRoot1 && !IsRoot2)
		{
			return -1;
		}
		else if(!IsRoot1 && IsRoot2)
		{
			return 1;
		}
		else if(IsRoot1 && IsRoot2)
		{
			/* If the items been compared are both drives,
			sort by drive letter, rather than display name. */
			return StrCmpLogicalW(itemInfo1.getFullPath().c_str(), itemInfo2.getFullPath().c_str());
		}
	}

	std::wstring Name1 = GetNameColumnText(itemInfo1, globalFolderSettings);
	std::wstring Name2 = GetNameColumnText(itemInfo2, globalFolderSettings);

	return StrCmpLogicalW(Name1.c_str(),Name2.c_str());
}
Example #2
0
int CALLBACK CShellBrowser::SortByFileSystem(int InternalIndex1,int InternalIndex2) const
{
	std::wstring FileSystemName1 = GetFileSystemColumnText(InternalIndex1);
	std::wstring FileSystemName2 = GetFileSystemColumnText(InternalIndex2);

	return StrCmpLogicalW(FileSystemName1.c_str(),FileSystemName2.c_str());
}
Example #3
0
int CALLBACK CShellBrowser::SortByNetworkAdapterStatus(int InternalIndex1,int InternalIndex2) const
{
	std::wstring Status1 = GetNetworkAdapterColumnText(InternalIndex1);
	std::wstring Status2 = GetNetworkAdapterColumnText(InternalIndex2);

	return StrCmpLogicalW(Status1.c_str(),Status2.c_str());
}
Example #4
0
int CALLBACK CShellBrowser::SortByExtension(int InternalIndex1,int InternalIndex2) const
{
	std::wstring Extension1 = GetExtensionColumnText(InternalIndex1);
	std::wstring Extension2 = GetExtensionColumnText(InternalIndex2);

	return StrCmpLogicalW(Extension1.c_str(),Extension2.c_str());
}
Example #5
0
int CALLBACK CShellBrowser::SortByImageProperty(int InternalIndex1,int InternalIndex2,PROPID PropertyId) const
{
	std::wstring ImageProperty1 = GetImageColumnText(InternalIndex1,PropertyId);
	std::wstring ImageProperty2 = GetImageColumnText(InternalIndex2,PropertyId);

	return StrCmpLogicalW(ImageProperty1.c_str(),ImageProperty2.c_str());
}
Example #6
0
int CALLBACK CShellBrowser::SortByShortName(int InternalIndex1,int InternalIndex2) const
{
	std::wstring ShortName1 = GetShortNameColumnText(InternalIndex1);
	std::wstring ShortName2 = GetShortNameColumnText(InternalIndex2);

	return StrCmpLogicalW(ShortName1.c_str(),ShortName2.c_str());
}
Example #7
0
int CALLBACK CShellBrowser::SortByVersionInfo(int InternalIndex1,int InternalIndex2,VersionInfoType_t VersioninfoType) const
{
	std::wstring VersionInfo1 = GetVersionColumnText(InternalIndex1,VersioninfoType);
	std::wstring VersionInfo2 = GetVersionColumnText(InternalIndex2,VersioninfoType);

	return StrCmpLogicalW(VersionInfo1.c_str(),VersionInfo2.c_str());
}
Example #8
0
int CALLBACK CShellBrowser::SortByShortcutTo(const BasicItemInfo_t &itemInfo1, const BasicItemInfo_t &itemInfo2) const
{
	std::wstring ResolvedLinkPath1 = GetShortcutToColumnText(itemInfo1);
	std::wstring ResolvedLinkPath2 = GetShortcutToColumnText(itemInfo2);

	return StrCmpLogicalW(ResolvedLinkPath1.c_str(),ResolvedLinkPath2.c_str());
}
Example #9
0
int CALLBACK CShellBrowser::SortByExtension(const BasicItemInfo_t &itemInfo1, const BasicItemInfo_t &itemInfo2) const
{
	std::wstring Extension1 = GetExtensionColumnText(itemInfo1);
	std::wstring Extension2 = GetExtensionColumnText(itemInfo2);

	return StrCmpLogicalW(Extension1.c_str(),Extension2.c_str());
}
Example #10
0
int CALLBACK CShellBrowser::SortByOwner(const BasicItemInfo_t &itemInfo1, const BasicItemInfo_t &itemInfo2) const
{
	std::wstring Owner1 = GetOwnerColumnText(itemInfo1);
	std::wstring Owner2 = GetOwnerColumnText(itemInfo2);

	return StrCmpLogicalW(Owner1.c_str(),Owner2.c_str());
}
Example #11
0
int CALLBACK CShellBrowser::SortByVersionInfo(const BasicItemInfo_t &itemInfo1, const BasicItemInfo_t &itemInfo2, VersionInfoType_t VersioninfoType) const
{
	std::wstring VersionInfo1 = GetVersionColumnText(itemInfo1,VersioninfoType);
	std::wstring VersionInfo2 = GetVersionColumnText(itemInfo2,VersioninfoType);

	return StrCmpLogicalW(VersionInfo1.c_str(),VersionInfo2.c_str());
}
Example #12
0
int CALLBACK CShellBrowser::SortByShortName(const BasicItemInfo_t &itemInfo1, const BasicItemInfo_t &itemInfo2) const
{
	std::wstring ShortName1 = GetShortNameColumnText(itemInfo1);
	std::wstring ShortName2 = GetShortNameColumnText(itemInfo2);

	return StrCmpLogicalW(ShortName1.c_str(),ShortName2.c_str());
}
Example #13
0
int CALLBACK CShellBrowser::SortByAttributes(const BasicItemInfo_t &itemInfo1, const BasicItemInfo_t &itemInfo2) const
{
	std::wstring AttributeString1 = GetAttributeColumnText(itemInfo1);
	std::wstring AttributeString2 = GetAttributeColumnText(itemInfo2);

	return StrCmpLogicalW(AttributeString1.c_str(),AttributeString2.c_str());
}
Example #14
0
int CALLBACK CShellBrowser::SortByType(const BasicItemInfo_t &itemInfo1, const BasicItemInfo_t &itemInfo2) const
{
	if(m_bVirtualFolder)
	{
		TCHAR FullFileName1[MAX_PATH];
		GetDisplayName(itemInfo1.pidlComplete.get(),FullFileName1,SIZEOF_ARRAY(FullFileName1),SHGDN_FORPARSING);

		TCHAR FullFileName2[MAX_PATH];
		GetDisplayName(itemInfo2.pidlComplete.get(),FullFileName2,SIZEOF_ARRAY(FullFileName2),SHGDN_FORPARSING);

		BOOL IsRoot1 = PathIsRoot(FullFileName1);
		BOOL IsRoot2 = PathIsRoot(FullFileName2);

		if(IsRoot1 && !IsRoot2)
		{
			return -1;
		}
		else if(!IsRoot1 && IsRoot2)
		{
			return 1;
		}
	}

	std::wstring Type1 = GetTypeColumnText(itemInfo1);
	std::wstring Type2 = GetTypeColumnText(itemInfo2);

	return StrCmpLogicalW(Type1.c_str(),Type2.c_str());
}
Example #15
0
int CALLBACK CShellBrowser::SortByType(int InternalIndex1,int InternalIndex2) const
{
	if(m_bVirtualFolder)
	{
		TCHAR FullFileName1[MAX_PATH];
		LPITEMIDLIST pidlComplete1 = ILCombine(m_pidlDirectory,m_pExtraItemInfo[InternalIndex1].pridl);
		GetDisplayName(pidlComplete1,FullFileName1,SHGDN_FORPARSING);
		CoTaskMemFree(pidlComplete1);

		TCHAR FullFileName2[MAX_PATH];
		LPITEMIDLIST pidlComplete2 = ILCombine(m_pidlDirectory,m_pExtraItemInfo[InternalIndex2].pridl);
		GetDisplayName(pidlComplete2,FullFileName2,SHGDN_FORPARSING);
		CoTaskMemFree(pidlComplete2);

		BOOL IsRoot1 = PathIsRoot(FullFileName1);
		BOOL IsRoot2 = PathIsRoot(FullFileName2);

		if(IsRoot1 && !IsRoot2)
		{
			return -1;
		}
		else if(!IsRoot1 && IsRoot2)
		{
			return 1;
		}
	}

	std::wstring Type1 = GetTypeColumnText(InternalIndex1);
	std::wstring Type2 = GetTypeColumnText(InternalIndex2);

	return StrCmpLogicalW(Type1.c_str(),Type2.c_str());
}
Example #16
0
int CALLBACK CShellBrowser::SortByImageProperty(const BasicItemInfo_t &itemInfo1, const BasicItemInfo_t &itemInfo2, PROPID PropertyId) const
{
	std::wstring ImageProperty1 = GetImageColumnText(itemInfo1,PropertyId);
	std::wstring ImageProperty2 = GetImageColumnText(itemInfo2,PropertyId);

	return StrCmpLogicalW(ImageProperty1.c_str(),ImageProperty2.c_str());
}
Example #17
0
int CALLBACK CShellBrowser::SortByAttributes(int InternalIndex1,int InternalIndex2) const
{
	std::wstring AttributeString1 = GetAttributeColumnText(InternalIndex1);
	std::wstring AttributeString2 = GetAttributeColumnText(InternalIndex2);

	return StrCmpLogicalW(AttributeString1.c_str(),AttributeString2.c_str());
}
Example #18
0
int CALLBACK CShellBrowser::SortByVirtualComments(const BasicItemInfo_t &itemInfo1, const BasicItemInfo_t &itemInfo2) const
{
	std::wstring Comments1 = GetControlPanelCommentsColumnText(itemInfo1);
	std::wstring Comments2 = GetControlPanelCommentsColumnText(itemInfo2);

	return StrCmpLogicalW(Comments1.c_str(),Comments2.c_str());
}
Example #19
0
int CALLBACK CShellBrowser::SortByOwner(int InternalIndex1,int InternalIndex2) const
{
	std::wstring Owner1 = GetOwnerColumnText(InternalIndex1);
	std::wstring Owner2 = GetOwnerColumnText(InternalIndex2);

	return StrCmpLogicalW(Owner1.c_str(),Owner2.c_str());
}
Example #20
0
int CALLBACK CShellBrowser::SortByFileSystem(const BasicItemInfo_t &itemInfo1, const BasicItemInfo_t &itemInfo2) const
{
	std::wstring FileSystemName1 = GetFileSystemColumnText(itemInfo1);
	std::wstring FileSystemName2 = GetFileSystemColumnText(itemInfo2);

	return StrCmpLogicalW(FileSystemName1.c_str(),FileSystemName2.c_str());
}
Example #21
0
int CALLBACK CShellBrowser::SortByShortcutTo(int InternalIndex1,int InternalIndex2) const
{
	std::wstring ResolvedLinkPath1 = GetShortcutToColumnText(InternalIndex1);
	std::wstring ResolvedLinkPath2 = GetShortcutToColumnText(InternalIndex2);

	return StrCmpLogicalW(ResolvedLinkPath1.c_str(),ResolvedLinkPath2.c_str());
}
Example #22
0
int CALLBACK CShellBrowser::SortByPrinterProperty(const BasicItemInfo_t &itemInfo1, const BasicItemInfo_t &itemInfo2, PrinterInformationType_t PrinterInformationType) const
{
	std::wstring PrinterInformation1 = GetPrinterColumnText(itemInfo1,PrinterInformationType);
	std::wstring PrinterInformation2 = GetPrinterColumnText(itemInfo2,PrinterInformationType);

	return StrCmpLogicalW(PrinterInformation1.c_str(),PrinterInformation2.c_str());
}
Example #23
0
int CALLBACK CShellBrowser::SortBySummaryProperty(int InternalIndex1,int InternalIndex2,DWORD PropertyType) const
{
	std::wstring FileProperty1 = GetSummaryColumnText(InternalIndex1,PropertyType);
	std::wstring FileProperty2 = GetSummaryColumnText(InternalIndex2,PropertyType);

	return StrCmpLogicalW(FileProperty1.c_str(),FileProperty2.c_str());
}
Example #24
0
int CALLBACK CShellBrowser::SortByNetworkAdapterStatus(const BasicItemInfo_t &itemInfo1, const BasicItemInfo_t &itemInfo2) const
{
	std::wstring Status1 = GetNetworkAdapterColumnText(itemInfo1);
	std::wstring Status2 = GetNetworkAdapterColumnText(itemInfo2);

	return StrCmpLogicalW(Status1.c_str(),Status2.c_str());
}
Example #25
0
int CALLBACK CShellBrowser::SortByVirtualComments(int InternalIndex1,int InternalIndex2) const
{
	std::wstring Comments1 = GetControlPanelCommentsColumnText(InternalIndex1);
	std::wstring Comments2 = GetControlPanelCommentsColumnText(InternalIndex2);

	return StrCmpLogicalW(Comments1.c_str(),Comments2.c_str());
}
Example #26
0
int CALLBACK CShellBrowser::SortByMediaMetadata(const BasicItemInfo_t &itemInfo1, const BasicItemInfo_t &itemInfo2, MediaMetadataType_t MediaMetaDataType) const
{
	std::wstring MediaMetadata1 = GetMediaMetadataColumnText(itemInfo1,MediaMetaDataType);
	std::wstring MediaMetadata2 = GetMediaMetadataColumnText(itemInfo2,MediaMetaDataType);

	return StrCmpLogicalW(MediaMetadata1.c_str(),MediaMetadata2.c_str());
}
Example #27
0
int CALLBACK CShellBrowser::SortByPrinterProperty(int InternalIndex1,int InternalIndex2,PrinterInformationType_t PrinterInformationType) const
{
	std::wstring PrinterInformation1 = GetPrinterColumnText(InternalIndex1,PrinterInformationType);
	std::wstring PrinterInformation2 = GetPrinterColumnText(InternalIndex2,PrinterInformationType);

	return StrCmpLogicalW(PrinterInformation1.c_str(),PrinterInformation2.c_str());
}
Example #28
0
static bool comp(string a, string b)
{
	bool ret;

	std::wstring stemp1 = s2ws(a);
	LPCWSTR lpa1 = stemp1.c_str();

	std::wstring stemp2 = s2ws(b);
	LPCWSTR lpa2 = stemp2.c_str();

	if (StrCmpLogicalW(lpa1, lpa2) >= 0)
	{
		ret = false;
	}
	else
	{
		ret = true;
	}

	if (reverseflag)
	{
		ret = !ret;
	}

	return ret;
}
Example #29
0
int CALLBACK CShellBrowser::SortByMediaMetadata(int InternalIndex1,int InternalIndex2,MediaMetadataType_t MediaMetaDataType) const
{
	std::wstring MediaMetadata1 = GetMediaMetadataColumnText(InternalIndex1,MediaMetaDataType);
	std::wstring MediaMetadata2 = GetMediaMetadataColumnText(InternalIndex2,MediaMetaDataType);

	return StrCmpLogicalW(MediaMetadata1.c_str(),MediaMetadata2.c_str());
}
Example #30
0
int CALLBACK CShellBrowser::SortBySummaryProperty(int InternalIndex1, int InternalIndex2, const SHCOLUMNID *pscid) const
{
	std::wstring FileProperty1 = GetSummaryColumnText(InternalIndex1, pscid);
	std::wstring FileProperty2 = GetSummaryColumnText(InternalIndex2, pscid);

	return StrCmpLogicalW(FileProperty1.c_str(), FileProperty2.c_str());
}