ReactOS 0.4.15-dev-7942-gd23573b
filedefext.h
Go to the documentation of this file.
1/*
2 * Provides default file shell extension
3 *
4 * Copyright 2012 Rafal Harabien
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#ifndef _FILE_DEF_EXT_H_
22#define _FILE_DEF_EXT_H_
23
25{
26 private:
30
31 typedef struct _LANGANDCODEPAGE_
32 {
36
37 public:
40 {
41 m_wszLang[0] = L'\0';
42 }
43
45 {
46 if (m_pInfo)
48 }
49
50 BOOL Load(LPCWSTR pwszPath);
51 LPCWSTR GetString(LPCWSTR pwszName);
54};
55
57 public CComCoClass<CFileDefExt, &CLSID_ShellFileDefExt>,
58 public CComObjectRootEx<CComMultiThreadModelNoCS>,
59 public IShellExtInit,
60 public IContextMenu,
61 public IShellPropSheetExt,
62 public IObjectWithSite
63{
64private:
66 BOOL InitFileType(HWND hwndDlg);
67 BOOL InitFilePath(HWND hwndDlg);
68 static BOOL GetFileTimeString(LPFILETIME lpFileTime, LPWSTR pwszResult, UINT cchResult);
69 BOOL InitFileAttr(HWND hwndDlg);
70 BOOL InitGeneralPage(HWND hwndDlg);
71 BOOL SetVersionLabel(HWND hwndDlg, DWORD idCtrl, LPCWSTR pwszName);
72 BOOL AddVersionString(HWND hwndDlg, LPCWSTR pwszName);
73 BOOL InitVersionPage(HWND hwndDlg);
78 BOOL CountFolderAndFiles(HWND hwndDlg, LPCWSTR pwszBuf, LPDWORD ticks);
79
83
88
90
91 // FolderCustomize
96
97public:
100
101 // FolderCustomize
102 BOOL OnFolderCustApply(HWND hwndDlg);
103 void OnFolderCustChangeIcon(HWND hwndDlg);
104 void OnFolderCustDestroy(HWND hwndDlg);
105 void UpdateFolderIcon(HWND hwndDlg);
106
107 // IShellExtInit
108 STDMETHOD(Initialize)(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID) override;
109
110 // IContextMenu
111 STDMETHOD(QueryContextMenu)(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override;
113 STDMETHOD(GetCommandString)(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax) override;
114
115 // IShellPropSheetExt
116 STDMETHOD(AddPages)(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam) override;
117 STDMETHOD(ReplacePage)(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam) override;
118
119 // IObjectWithSite
120 STDMETHOD(SetSite)(IUnknown *punk) override;
121 STDMETHOD(GetSite)(REFIID iid, void **ppvSite) override;
122
125
127
129 COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit)
130 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
131 COM_INTERFACE_ENTRY_IID(IID_IShellPropSheetExt, IShellPropSheetExt)
134};
135
140};
141
142#endif /* _FILE_DEF_EXT_H_ */
UINT cchMax
#define STDMETHOD(m)
Definition: basetyps.h:62
static INT_PTR CALLBACK VersionPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: filedefext.cpp:939
STDMETHOD() ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam) override
static BOOL GetFileTimeString(LPFILETIME lpFileTime, LPWSTR pwszResult, UINT cchResult)
Definition: filedefext.cpp:498
BOOL InitFileAttr(HWND hwndDlg)
Definition: filedefext.cpp:536
void OnFolderCustDestroy(HWND hwndDlg)
BOOL InitFileType(HWND hwndDlg)
Definition: filedefext.cpp:410
WCHAR m_szFolderIconPath[MAX_PATH]
Definition: filedefext.h:92
ULARGE_INTEGER m_DirSize
Definition: filedefext.h:86
VOID InitOpensWithField(HWND hwndDlg)
Definition: filedefext.cpp:322
BOOL InitVersionPage(HWND hwndDlg)
Definition: filedefext.cpp:822
STDMETHOD() InvokeCommand(LPCMINVOKECOMMANDINFO lpici) override
static INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: filedefext.cpp:720
void UpdateFolderIcon(HWND hwndDlg)
BOOL OnFolderCustApply(HWND hwndDlg)
BOOL InitFilePath(HWND hwndDlg)
Definition: filedefext.cpp:469
BOOL InitFolderCustomizePage(HWND hwndDlg)
DWORD m_cFiles
Definition: filedefext.h:84
ULARGE_INTEGER m_DirSizeOnDisc
Definition: filedefext.h:87
STDMETHOD() SetSite(IUnknown *punk) override
BOOL m_bFolderIconIsSet
Definition: filedefext.h:95
STDMETHOD() AddPages(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam) override
WCHAR m_wszPath[MAX_PATH]
Definition: filedefext.h:80
static INT_PTR CALLBACK FolderCustomizePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: filedefext.cpp:998
void OnFolderCustChangeIcon(HWND hwndDlg)
INT m_nFolderIconIndex
Definition: filedefext.h:93
DWORD m_cFolders
Definition: filedefext.h:85
BOOL m_bDir
Definition: filedefext.h:82
STDMETHOD() GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax) override
BOOL InitGeneralPage(HWND hwndDlg)
Definition: filedefext.cpp:664
HICON m_hFolderIcon
Definition: filedefext.h:94
CFileVersionInfo m_VerInfo
Definition: filedefext.h:81
BOOL CountFolderAndFiles(HWND hwndDlg, LPCWSTR pwszBuf, LPDWORD ticks)
BOOL AddVersionString(HWND hwndDlg, LPCWSTR pwszName)
Definition: filedefext.cpp:910
STDMETHOD() QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override
STDMETHOD() GetSite(REFIID iid, void **ppvSite) override
BOOL SetVersionLabel(HWND hwndDlg, DWORD idCtrl, LPCWSTR pwszName)
Definition: filedefext.cpp:885
static DWORD WINAPI _CountFolderAndFilesThreadProc(LPVOID lpParameter)
struct CFileVersionInfo::_LANGANDCODEPAGE_ * LPLANGANDCODEPAGE
WCHAR m_wszLang[64]
Definition: filedefext.h:29
struct CFileVersionInfo::_LANGANDCODEPAGE_ LANGANDCODEPAGE
BOOL Load(LPCWSTR pwszPath)
Definition: filedefext.cpp:82
LPCWSTR GetString(LPCWSTR pwszName)
Definition: filedefext.cpp:123
VS_FIXEDFILEINFO * GetFixedInfo()
Definition: filedefext.cpp:153
LPCWSTR GetLangName()
Definition: filedefext.cpp:165
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
UINT uFlags
Definition: api.c:59
#define GetProcessHeap()
Definition: compat.h:736
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:679
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:651
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:645
#define END_COM_MAP()
Definition: atlcom.h:592
static HICON
Definition: imagelist.c:84
const IID IID_IObjectWithSite
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
BOOL(CALLBACK * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM)
Definition: prsht.h:327
#define REFIID
Definition: guiddef.h:118
#define IDR_FILEDEFEXT
Definition: shresdef.h:899
int32_t INT_PTR
Definition: typedefs.h:64
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
static HMENU hmenu
Definition: win.c:66
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
static void Initialize()
Definition: xlate.c:212
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185