32 const SHCOLUMNINFO ColumnInfoTable[] =
34 {{PSGUID_SUMMARYINFORMATION, PIDSI_TITLE},
VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L
"Title", L
"Title"},
35 {{PSGUID_SUMMARYINFORMATION, PIDSI_AUTHOR},
VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L
"Author", L
"Author"},
36 {{PSGUID_SUMMARYINFORMATION, PIDSI_SUBJECT},
VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L
"Subject", L
"Subject"},
37 {{PSGUID_SUMMARYINFORMATION, PIDSI_KEYWORDS},
VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L
"Keywords", L
"Keywords"},
38 {{PSGUID_SUMMARYINFORMATION, PIDSI_COMMENTS},
VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L
"Comments", L
"Comments"},
39 {{PSGUID_SUMMARYINFORMATION, PIDSI_PAGECOUNT},
VT_BSTR, LVCFMT_LEFT, 30, SHCOLSTATE_TYPE_STR, L
"Pagecount", L
"Pagecount"}
44bool IsOOFileExtension(
wchar_t const * Extension)
78 if (IID_IUnknown == riid || IID_IColumnProvider == riid)
80 IUnknown* pUnk =
this;
92 return InterlockedIncrement(&
m_RefCnt);
118 if (dwIndex >= ColumnInfoTableSize)
125 psci->scid.fmtid = ColumnInfoTable[dwIndex].scid.fmtid;
126 psci->scid.pid = ColumnInfoTable[dwIndex].scid.pid;
127 ZeroMemory(psci->wszTitle,
sizeof(psci->wszTitle));
128 wcsncpy(psci->wszTitle, ColumnInfoTable[dwIndex].wszTitle,
134COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE
CColumnInfo::GetItemData(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, VARIANT *pvarData)
136 if (IsOOFileExtension(pscd->pwszExt))
144 VariantClear(pvarData);
146 if (IsEqualGUID (pscid->fmtid, FMTID_SummaryInformation) && pscid->pid == PIDSI_TITLE)
153 else if (IsEqualGUID (pscid->fmtid, FMTID_SummaryInformation) && pscid->pid == PIDSI_AUTHOR)
160 else if (IsEqualGUID (pscid->fmtid, FMTID_SummaryInformation) && pscid->pid == PIDSI_SUBJECT)
167 else if (IsEqualGUID (pscid->fmtid, FMTID_SummaryInformation) && pscid->pid == PIDSI_KEYWORDS)
174 else if (IsEqualGUID (pscid->fmtid, FMTID_SummaryInformation) && pscid->pid == PIDSI_COMMENTS)
181 else if (IsEqualGUID (pscid->fmtid, FMTID_SummaryInformation) && pscid->pid == PIDSI_PAGECOUNT)
189 catch (
const std::exception&)
virtual COM_DECLSPEC_NOTHROW ULONG STDMETHODCALLTYPE Release() override
virtual COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE GetItemData(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, VARIANT *pvarData) override
virtual COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject) override
virtual COM_DECLSPEC_NOTHROW ULONG STDMETHODCALLTYPE AddRef() override
CColumnInfo(LONG RefCnt=1)
virtual COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE Initialize(LPCSHCOLUMNINIT psci) override
virtual COM_DECLSPEC_NOTHROW HRESULT STDMETHODCALLTYPE GetColumnInfo(DWORD dwIndex, SHCOLUMNINFO *psci) override
#define META_INFO_DOCUMENT_STATISTIC
#define META_INFO_SUBJECT
#define META_INFO_KEYWORDS
#define META_INFO_DESCRIPTION
const FileExtensionEntry OOFileExtensionTable[]
const size_t OOFileExtensionTableSize
#define SAL_N_ELEMENTS(arr)
std::wstring getShortPathName(const std::wstring &aLongName)
helper function to convert windows paths to short form.