xref: /trunk/main/shell/source/win32/shlxthandler/propsheets/propsheets.cxx (revision 7ed02bbb1fdafc26a1c6b8509e195439d410cee9)
1f8e2c85aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3f8e2c85aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4f8e2c85aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5f8e2c85aSAndrew Rist  * distributed with this work for additional information
6f8e2c85aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7f8e2c85aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8f8e2c85aSAndrew Rist  * "License"); you may not use this file except in compliance
9f8e2c85aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11f8e2c85aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13f8e2c85aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14f8e2c85aSAndrew Rist  * software distributed under the License is distributed on an
15f8e2c85aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f8e2c85aSAndrew Rist  * KIND, either express or implied.  See the License for the
17f8e2c85aSAndrew Rist  * specific language governing permissions and limitations
18f8e2c85aSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20f8e2c85aSAndrew Rist  *************************************************************/
21f8e2c85aSAndrew Rist 
22f8e2c85aSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_shell.hxx"
26cdf0e10cSrcweir #include "internal/config.hxx"
27cdf0e10cSrcweir #include "internal/global.hxx"
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #ifndef PROPSEETS_HXX_INCLUDED
30cdf0e10cSrcweir #include "internal/propsheets.hxx"
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #include "internal/utilities.hxx"
33cdf0e10cSrcweir #include "internal/resource.h"
34cdf0e10cSrcweir #include "listviewbuilder.hxx"
35cdf0e10cSrcweir 
36cdf0e10cSrcweir #if defined _MSC_VER
37cdf0e10cSrcweir #pragma warning(push, 1)
38cdf0e10cSrcweir #endif
39cdf0e10cSrcweir #include <shellapi.h>
40cdf0e10cSrcweir #if defined _MSC_VER
41cdf0e10cSrcweir #pragma warning(pop)
42cdf0e10cSrcweir #endif
43cdf0e10cSrcweir 
44cdf0e10cSrcweir #include <string>
45cdf0e10cSrcweir #include <vector>
46cdf0e10cSrcweir #include <utility>
47cdf0e10cSrcweir #include <strsafe.h>
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 
50cdf0e10cSrcweir /*---------------------------------------------
51cdf0e10cSrcweir     INFO - INFO - INFO - INFO - INFO - INFO
52cdf0e10cSrcweir 
53cdf0e10cSrcweir     See MSDN "Using Windows XP Visual Styles"
54cdf0e10cSrcweir     for hints how to enable the new common
55cdf0e10cSrcweir     control library for our property sheet.
56cdf0e10cSrcweir 
57cdf0e10cSrcweir     INFO - INFO - INFO - INFO - INFO - INFO
58cdf0e10cSrcweir ----------------------------------------------*/
59cdf0e10cSrcweir 
60cdf0e10cSrcweir //-----------------------------
61cdf0e10cSrcweir //
62cdf0e10cSrcweir //-----------------------------
63cdf0e10cSrcweir 
CPropertySheet(long RefCnt)64cdf0e10cSrcweir CPropertySheet::CPropertySheet(long RefCnt) :
65cdf0e10cSrcweir     m_RefCnt(RefCnt)
66cdf0e10cSrcweir {
67cdf0e10cSrcweir     OutputDebugStringFormat("CPropertySheet::CTor [%d], [%d]", m_RefCnt, g_DllRefCnt );
68cdf0e10cSrcweir     InterlockedIncrement(&g_DllRefCnt);
69cdf0e10cSrcweir }
70cdf0e10cSrcweir 
71cdf0e10cSrcweir //-----------------------------
72cdf0e10cSrcweir //
73cdf0e10cSrcweir //-----------------------------
74cdf0e10cSrcweir 
~CPropertySheet()75cdf0e10cSrcweir CPropertySheet::~CPropertySheet()
76cdf0e10cSrcweir {
77cdf0e10cSrcweir     OutputDebugStringFormat("CPropertySheet::DTor [%d], [%d]", m_RefCnt, g_DllRefCnt );
78cdf0e10cSrcweir     InterlockedDecrement(&g_DllRefCnt);
79cdf0e10cSrcweir }
80cdf0e10cSrcweir 
81cdf0e10cSrcweir //-----------------------------
82cdf0e10cSrcweir // IUnknown methods
83cdf0e10cSrcweir //-----------------------------
84cdf0e10cSrcweir 
QueryInterface(REFIID riid,void __RPC_FAR * __RPC_FAR * ppvObject)85cdf0e10cSrcweir HRESULT STDMETHODCALLTYPE CPropertySheet::QueryInterface(
86cdf0e10cSrcweir     REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject)
87cdf0e10cSrcweir {
88cdf0e10cSrcweir     *ppvObject = 0;
89cdf0e10cSrcweir 
90cdf0e10cSrcweir     IUnknown* pUnk = 0;
91cdf0e10cSrcweir     if (IID_IUnknown == riid || IID_IShellExtInit == riid)
92cdf0e10cSrcweir     {
93cdf0e10cSrcweir         pUnk = static_cast<IShellExtInit*>(this);
94cdf0e10cSrcweir         pUnk->AddRef();
95cdf0e10cSrcweir         *ppvObject = pUnk;
96cdf0e10cSrcweir         return S_OK;
97cdf0e10cSrcweir     }
98cdf0e10cSrcweir     else if (IID_IShellPropSheetExt == riid)
99cdf0e10cSrcweir     {
100cdf0e10cSrcweir         pUnk = static_cast<IShellPropSheetExt*>(this);
101cdf0e10cSrcweir         pUnk->AddRef();
102cdf0e10cSrcweir         *ppvObject = pUnk;
103cdf0e10cSrcweir         return S_OK;
104cdf0e10cSrcweir     }
105cdf0e10cSrcweir 
106cdf0e10cSrcweir     return E_NOINTERFACE;
107cdf0e10cSrcweir }
108cdf0e10cSrcweir 
109cdf0e10cSrcweir //-----------------------------
110cdf0e10cSrcweir //
111cdf0e10cSrcweir //-----------------------------
112cdf0e10cSrcweir 
AddRef(void)113cdf0e10cSrcweir ULONG STDMETHODCALLTYPE CPropertySheet::AddRef(void)
114cdf0e10cSrcweir {
115cdf0e10cSrcweir     OutputDebugStringFormat("CPropertySheet::AddRef [%d]", m_RefCnt );
116cdf0e10cSrcweir     return InterlockedIncrement(&m_RefCnt);
117cdf0e10cSrcweir }
118cdf0e10cSrcweir 
119cdf0e10cSrcweir //-----------------------------
120cdf0e10cSrcweir //
121cdf0e10cSrcweir //-----------------------------
122cdf0e10cSrcweir 
Release(void)123cdf0e10cSrcweir ULONG STDMETHODCALLTYPE CPropertySheet::Release(void)
124cdf0e10cSrcweir {
125cdf0e10cSrcweir     OutputDebugStringFormat("CPropertySheet::Release [%d]", m_RefCnt );
126cdf0e10cSrcweir     long refcnt = InterlockedDecrement(&m_RefCnt);
127cdf0e10cSrcweir 
128cdf0e10cSrcweir     if (0 == refcnt)
129cdf0e10cSrcweir         delete this;
130cdf0e10cSrcweir 
131cdf0e10cSrcweir     return refcnt;
132cdf0e10cSrcweir }
133cdf0e10cSrcweir 
134cdf0e10cSrcweir //-----------------------------
135cdf0e10cSrcweir // IShellExtInit
136cdf0e10cSrcweir //-----------------------------
137cdf0e10cSrcweir 
Initialize(LPCITEMIDLIST,LPDATAOBJECT lpdobj,HKEY)138cdf0e10cSrcweir HRESULT STDMETHODCALLTYPE CPropertySheet::Initialize(
139cdf0e10cSrcweir     LPCITEMIDLIST /*pidlFolder*/, LPDATAOBJECT lpdobj, HKEY /*hkeyProgID*/)
140cdf0e10cSrcweir {
141cdf0e10cSrcweir     InitCommonControls();
142cdf0e10cSrcweir 
143cdf0e10cSrcweir     STGMEDIUM medium;
144cdf0e10cSrcweir     FORMATETC fe = {CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
145cdf0e10cSrcweir 
146cdf0e10cSrcweir     HRESULT hr = lpdobj->GetData(&fe, &medium);
147cdf0e10cSrcweir 
148cdf0e10cSrcweir     // save the file name
149cdf0e10cSrcweir     if (SUCCEEDED(hr) &&
150cdf0e10cSrcweir         (1 == DragQueryFileA(
151cdf0e10cSrcweir             reinterpret_cast<HDROP>(medium.hGlobal),
152cdf0e10cSrcweir             0xFFFFFFFF,
153cdf0e10cSrcweir             NULL,
154cdf0e10cSrcweir             0)))
155cdf0e10cSrcweir     {
156cdf0e10cSrcweir         UINT size = DragQueryFile( reinterpret_cast<HDROP>(medium.hGlobal), 0, 0, 0 );
157cdf0e10cSrcweir         if ( size != 0 )
158cdf0e10cSrcweir         {
159cdf0e10cSrcweir             TCHAR * buffer = new TCHAR[ size + 1 ];
160cdf0e10cSrcweir             UINT result_size = DragQueryFile( reinterpret_cast<HDROP>(medium.hGlobal),
161cdf0e10cSrcweir                                               0, buffer, size + 1 );
162cdf0e10cSrcweir             if ( result_size != 0 )
163cdf0e10cSrcweir             {
164cdf0e10cSrcweir                 std::wstring fname = getShortPathName( buffer );
165cdf0e10cSrcweir                 std::string fnameA = WStringToString( fname );
166cdf0e10cSrcweir                 ZeroMemory( m_szFileName, sizeof( m_szFileName ) );
167cdf0e10cSrcweir                 strncpy( m_szFileName, fnameA.c_str(), ( sizeof( m_szFileName ) - 1 ) );
168cdf0e10cSrcweir                 hr = S_OK;
169cdf0e10cSrcweir             }
170cdf0e10cSrcweir             else
171cdf0e10cSrcweir                 hr = E_INVALIDARG;
172cdf0e10cSrcweir             delete [] buffer;
173cdf0e10cSrcweir         }
174cdf0e10cSrcweir         else
175cdf0e10cSrcweir             hr = E_INVALIDARG;
176cdf0e10cSrcweir     }
177cdf0e10cSrcweir     else
178cdf0e10cSrcweir         hr = E_INVALIDARG;
179cdf0e10cSrcweir 
180cdf0e10cSrcweir     ReleaseStgMedium(&medium);
181cdf0e10cSrcweir 
182cdf0e10cSrcweir     return hr;
183cdf0e10cSrcweir }
184cdf0e10cSrcweir 
185cdf0e10cSrcweir //-----------------------------
186cdf0e10cSrcweir // IShellPropSheetExt
187cdf0e10cSrcweir //-----------------------------
188cdf0e10cSrcweir 
AddPages(LPFNADDPROPSHEETPAGE lpfnAddPage,LPARAM lParam)189cdf0e10cSrcweir HRESULT STDMETHODCALLTYPE CPropertySheet::AddPages(LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
190cdf0e10cSrcweir {
191cdf0e10cSrcweir     // Get OS version (we don't need the summary page on Windows Vista or later)
192cdf0e10cSrcweir     OSVERSIONINFO sInfoOS;
193cdf0e10cSrcweir 
194cdf0e10cSrcweir     ZeroMemory( &sInfoOS, sizeof(OSVERSIONINFO) );
195cdf0e10cSrcweir     sInfoOS.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
196cdf0e10cSrcweir     GetVersionEx( &sInfoOS );
197cdf0e10cSrcweir     bool bIsVistaOrLater = (sInfoOS.dwMajorVersion >= 6);
198cdf0e10cSrcweir 
199cdf0e10cSrcweir     std::wstring proppage_header;
200cdf0e10cSrcweir 
201cdf0e10cSrcweir     PROPSHEETPAGE psp;
202cdf0e10cSrcweir     ZeroMemory(&psp, sizeof(PROPSHEETPAGEA));
203cdf0e10cSrcweir 
204cdf0e10cSrcweir     // add the summary property page
205cdf0e10cSrcweir     psp.dwSize      = sizeof(PROPSHEETPAGE);
206cdf0e10cSrcweir     psp.dwFlags     = PSP_DEFAULT | PSP_USETITLE | PSP_USECALLBACK;
207cdf0e10cSrcweir     psp.hInstance   = GetModuleHandle(MODULE_NAME);
208cdf0e10cSrcweir     psp.lParam      = reinterpret_cast<LPARAM>(this);
209cdf0e10cSrcweir     psp.pfnCallback = reinterpret_cast<LPFNPSPCALLBACK>(CPropertySheet::PropPageSummaryCallback);
210cdf0e10cSrcweir 
211cdf0e10cSrcweir     HPROPSHEETPAGE hPage = NULL;
212cdf0e10cSrcweir 
213cdf0e10cSrcweir     if ( !bIsVistaOrLater )
214cdf0e10cSrcweir     {
215cdf0e10cSrcweir         proppage_header = GetResString(IDS_PROPPAGE_SUMMARY_TITLE);
216cdf0e10cSrcweir 
217cdf0e10cSrcweir         psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_SUMMARY);
218cdf0e10cSrcweir         psp.pszTitle    = proppage_header.c_str();
219cdf0e10cSrcweir         psp.pfnDlgProc  = reinterpret_cast<DLGPROC>(CPropertySheet::PropPageSummaryProc);
220cdf0e10cSrcweir 
221cdf0e10cSrcweir         hPage = CreatePropertySheetPage(&psp);
222cdf0e10cSrcweir 
223cdf0e10cSrcweir         // keep this instance alive, will be released when the
224cdf0e10cSrcweir         // the page is about to be destroyed in the callback function
225cdf0e10cSrcweir 
226cdf0e10cSrcweir         if (hPage)
227cdf0e10cSrcweir         {
228cdf0e10cSrcweir             if (lpfnAddPage(hPage, lParam))
229cdf0e10cSrcweir                 AddRef();
230cdf0e10cSrcweir             else
231cdf0e10cSrcweir                 DestroyPropertySheetPage(hPage);
232cdf0e10cSrcweir         }
233cdf0e10cSrcweir     }
234cdf0e10cSrcweir 
235cdf0e10cSrcweir     // add the statistics property page
236cdf0e10cSrcweir     proppage_header = GetResString(IDS_PROPPAGE_STATISTICS_TITLE);
237cdf0e10cSrcweir 
238cdf0e10cSrcweir     psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_STATISTICS);
239cdf0e10cSrcweir     psp.pszTitle    = proppage_header.c_str();
240cdf0e10cSrcweir     psp.pfnDlgProc  = reinterpret_cast<DLGPROC>(CPropertySheet::PropPageStatisticsProc);
241cdf0e10cSrcweir 
242cdf0e10cSrcweir     hPage = CreatePropertySheetPage(&psp);
243cdf0e10cSrcweir 
244cdf0e10cSrcweir     if (hPage)
245cdf0e10cSrcweir     {
246cdf0e10cSrcweir         if (lpfnAddPage(hPage, lParam))
247cdf0e10cSrcweir             AddRef();
248cdf0e10cSrcweir         else
249cdf0e10cSrcweir             DestroyPropertySheetPage(hPage);
250cdf0e10cSrcweir     }
251cdf0e10cSrcweir 
252cdf0e10cSrcweir     // always return success else
253cdf0e10cSrcweir     // no property sheet will be
254cdf0e10cSrcweir     // displayed at all
255cdf0e10cSrcweir     return NOERROR;
256cdf0e10cSrcweir }
257cdf0e10cSrcweir 
258cdf0e10cSrcweir //-----------------------------
259cdf0e10cSrcweir //
260cdf0e10cSrcweir //-----------------------------
261cdf0e10cSrcweir 
ReplacePage(UINT,LPFNADDPROPSHEETPAGE,LPARAM)262cdf0e10cSrcweir HRESULT STDMETHODCALLTYPE CPropertySheet::ReplacePage(
263cdf0e10cSrcweir     UINT /*uPageID*/, LPFNADDPROPSHEETPAGE /*lpfnReplaceWith*/, LPARAM /*lParam*/)
264cdf0e10cSrcweir {
265cdf0e10cSrcweir     return E_NOTIMPL;
266cdf0e10cSrcweir }
267cdf0e10cSrcweir 
268cdf0e10cSrcweir //-----------------------------
269cdf0e10cSrcweir //
270cdf0e10cSrcweir //-----------------------------
271cdf0e10cSrcweir 
PropPageSummaryCallback(HWND,UINT uMsg,LPPROPSHEETPAGE ppsp)272cdf0e10cSrcweir UINT CALLBACK CPropertySheet::PropPageSummaryCallback(
273cdf0e10cSrcweir     HWND /*hwnd*/, UINT uMsg, LPPROPSHEETPAGE ppsp)
274cdf0e10cSrcweir {
275cdf0e10cSrcweir     CPropertySheet* pImpl =
276cdf0e10cSrcweir         reinterpret_cast<CPropertySheet*>(ppsp->lParam);
277cdf0e10cSrcweir 
278cdf0e10cSrcweir     // release this instance, acquired
279cdf0e10cSrcweir     // in the AddPages method
280cdf0e10cSrcweir     if (PSPCB_RELEASE == uMsg)
281cdf0e10cSrcweir     {
282cdf0e10cSrcweir         pImpl->Release();
283cdf0e10cSrcweir     }
284cdf0e10cSrcweir 
285cdf0e10cSrcweir     return TRUE;
286cdf0e10cSrcweir }
287cdf0e10cSrcweir 
288cdf0e10cSrcweir 
289cdf0e10cSrcweir //-----------------------------
290cdf0e10cSrcweir //
291cdf0e10cSrcweir //-----------------------------
292cdf0e10cSrcweir 
PropPageSummaryProc(HWND hwnd,UINT uiMsg,WPARAM,LPARAM lParam)293cdf0e10cSrcweir BOOL CALLBACK CPropertySheet::PropPageSummaryProc(HWND hwnd, UINT uiMsg, WPARAM /*wParam*/, LPARAM lParam)
294cdf0e10cSrcweir {
295cdf0e10cSrcweir     switch (uiMsg)
296cdf0e10cSrcweir     {
297cdf0e10cSrcweir     case WM_INITDIALOG:
298cdf0e10cSrcweir         {
299cdf0e10cSrcweir             LPPROPSHEETPAGE psp = reinterpret_cast<LPPROPSHEETPAGE>(lParam);
300cdf0e10cSrcweir             CPropertySheet* pImpl = reinterpret_cast<CPropertySheet*>(psp->lParam);
301cdf0e10cSrcweir             pImpl->InitPropPageSummary(hwnd, psp);
302cdf0e10cSrcweir             return TRUE;
303cdf0e10cSrcweir         }
304cdf0e10cSrcweir     }
305cdf0e10cSrcweir 
306cdf0e10cSrcweir     return FALSE;
307cdf0e10cSrcweir }
308cdf0e10cSrcweir 
309cdf0e10cSrcweir //-----------------------------
310cdf0e10cSrcweir //
311cdf0e10cSrcweir //-----------------------------
312cdf0e10cSrcweir 
PropPageStatisticsProc(HWND hwnd,UINT uiMsg,WPARAM,LPARAM lParam)313cdf0e10cSrcweir BOOL CALLBACK CPropertySheet::PropPageStatisticsProc(HWND hwnd, UINT uiMsg, WPARAM /*wParam*/, LPARAM lParam)
314cdf0e10cSrcweir {
315cdf0e10cSrcweir     switch (uiMsg)
316cdf0e10cSrcweir     {
317cdf0e10cSrcweir     case WM_INITDIALOG:
318cdf0e10cSrcweir         {
319cdf0e10cSrcweir             LPPROPSHEETPAGE psp = reinterpret_cast<LPPROPSHEETPAGE>(lParam);
320cdf0e10cSrcweir             CPropertySheet* pImpl = reinterpret_cast<CPropertySheet*>(psp->lParam);
321cdf0e10cSrcweir             pImpl->InitPropPageStatistics(hwnd, psp);
322cdf0e10cSrcweir             return TRUE;
323cdf0e10cSrcweir         }
324cdf0e10cSrcweir     }
325cdf0e10cSrcweir 
326cdf0e10cSrcweir     return FALSE;
327cdf0e10cSrcweir }
328cdf0e10cSrcweir 
329cdf0e10cSrcweir //##################################
InitPropPageSummary(HWND hwnd,LPPROPSHEETPAGE)330cdf0e10cSrcweir void CPropertySheet::InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/)
331cdf0e10cSrcweir {
332cdf0e10cSrcweir     try
333cdf0e10cSrcweir     {
334cdf0e10cSrcweir         CMetaInfoReader metaInfo(m_szFileName);
335cdf0e10cSrcweir 
336cdf0e10cSrcweir         SetWindowText(GetDlgItem(hwnd,IDC_TITLE),    metaInfo.getTagData( META_INFO_TITLE ).c_str() );
337cdf0e10cSrcweir         SetWindowText(GetDlgItem(hwnd,IDC_AUTHOR),   metaInfo.getTagData( META_INFO_AUTHOR ).c_str() );
338cdf0e10cSrcweir         SetWindowText(GetDlgItem(hwnd,IDC_SUBJECT),  metaInfo.getTagData( META_INFO_SUBJECT ).c_str() );
339cdf0e10cSrcweir         SetWindowText(GetDlgItem(hwnd,IDC_KEYWORDS), metaInfo.getTagData( META_INFO_KEYWORDS ).c_str() );
340cdf0e10cSrcweir 
341cdf0e10cSrcweir         // comments read from meta.xml use "\n" for return, but this will not displayable in Edit control, add
342cdf0e10cSrcweir         // "\r" before "\n" to form "\r\n" in order to display return in Edit control.
343cdf0e10cSrcweir         std::wstring tempStr = metaInfo.getTagData( META_INFO_DESCRIPTION ).c_str();
344cdf0e10cSrcweir         std::wstring::size_type itor = tempStr.find ( L"\n" , 0 );
345cdf0e10cSrcweir         while (itor != std::wstring::npos)
346cdf0e10cSrcweir         {
347cdf0e10cSrcweir             tempStr.insert(itor, L"\r");
348cdf0e10cSrcweir             itor = tempStr.find(L"\n", itor + 2);
349cdf0e10cSrcweir         }
350cdf0e10cSrcweir         SetWindowText(GetDlgItem(hwnd,IDC_COMMENTS), tempStr.c_str());
351cdf0e10cSrcweir     }
352cdf0e10cSrcweir     catch (const std::exception&)
353cdf0e10cSrcweir     {
354cdf0e10cSrcweir     }
355cdf0e10cSrcweir }
356cdf0e10cSrcweir 
357cdf0e10cSrcweir //---------------------------------
358cdf0e10cSrcweir /**
359cdf0e10cSrcweir */
InitPropPageStatistics(HWND hwnd,LPPROPSHEETPAGE)360cdf0e10cSrcweir void CPropertySheet::InitPropPageStatistics(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/)
361cdf0e10cSrcweir {
362cdf0e10cSrcweir     try
363cdf0e10cSrcweir     {
364cdf0e10cSrcweir         CMetaInfoReader metaInfo(m_szFileName);
365cdf0e10cSrcweir 
366cdf0e10cSrcweir         document_statistic_reader_ptr doc_stat_reader = create_document_statistic_reader(m_szFileName, &metaInfo);
367cdf0e10cSrcweir 
368cdf0e10cSrcweir         statistic_group_list_t sgl;
369cdf0e10cSrcweir         doc_stat_reader->read(&sgl);
370cdf0e10cSrcweir 
371cdf0e10cSrcweir         list_view_builder_ptr lv_builder = create_list_view_builder(
372cdf0e10cSrcweir             GetDlgItem(hwnd, IDC_STATISTICSLIST),
373cdf0e10cSrcweir             GetResString(IDS_PROPERTY),
374cdf0e10cSrcweir             GetResString(IDS_PROPERTY_VALUE));
375cdf0e10cSrcweir 
376cdf0e10cSrcweir         lv_builder->build(sgl);
377cdf0e10cSrcweir     }
378cdf0e10cSrcweir     catch (const std::exception&)
379cdf0e10cSrcweir     {
380cdf0e10cSrcweir     }
381cdf0e10cSrcweir }
382*7ed02bbbSmseidel 
383*7ed02bbbSmseidel /* vim: set noet sw=4 ts=4: */
384