-
Notifications
You must be signed in to change notification settings - Fork 1
/
WinRefineShlExt.h
74 lines (58 loc) · 2.19 KB
/
WinRefineShlExt.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// WinRefineShlExt.h : Declaration of the CWinRefineShlExt
#ifndef __WINREFINESHLEXT_H_
#define __WINREFINESHLEXT_H_
#include "resource.h" // main symbols
#include "ThumbDialog.h"
#include <atlwin.h>
#include <comdef.h>
#include <shlobj.h>
#include <shlguid.h>
struct __declspec(uuid("00021500-0000-0000-c000-000000000046")) IQueryInfo;
/////////////////////////////////////////////////////////////////////////////
// CWinRefineShlExt
class ATL_NO_VTABLE CWinRefineShlExt :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CWinRefineShlExt, &CLSID_WinRefineShlExt>,
public IDispatchImpl<IWinRefineShlExt, &IID_IWinRefineShlExt, &LIBID_WINREFINELib>,
public IPersistFile,
public IQueryInfo
{
public:
DECLARE_REGISTRY_RESOURCEID(IDR_WINREFINESHLEXT)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CWinRefineShlExt)
COM_INTERFACE_ENTRY_IID(IID_IWinRefineShlExt, IWinRefineShlExt)
COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
COM_INTERFACE_ENTRY(IPersistFile)
COM_INTERFACE_ENTRY_IID(IID_IQueryInfo, IQueryInfo)
END_COM_MAP()
// IWinRefineShlExt
public:
CWinRefineShlExt();
CString GetFileName(CString m_sFilename);
CString GetFileExt(CString m_sFilename);
//IPersistFile
STDMETHODIMP GetClassID(LPCLSID);
STDMETHODIMP IsDirty() { return E_NOTIMPL; }
STDMETHODIMP Load(LPCOLESTR, DWORD);
STDMETHODIMP Save(LPCOLESTR, BOOL) { return E_NOTIMPL; }
STDMETHODIMP SaveCompleted(LPCOLESTR) { return E_NOTIMPL; }
STDMETHODIMP GetCurFile(LPOLESTR*) { return E_NOTIMPL; }
//IQueryInfo
STDMETHODIMP GetInfoFlags(DWORD*) { return E_NOTIMPL; }
STDMETHODIMP GetInfoTip(DWORD dwFlags, LPWSTR* szStr);
private:
void ShowDialog(CPoint Point, CString FileName, HWND Parent);
void CloseDialog();
static DWORD WINAPI GeneralPreviewThread(LPVOID params);
HRESULT GetInfoTipFromFile(CWinRefineShlExt* pnt, wchar_t* file, LPTSTR pszText, int cchTextMax);
bool CanGo(HWND ListCtrl, int Sel2);
bool IsValidAudioVideo(CComBSTR m_sFilename);
bool IsValidImage(CComBSTR m_sFilename);
void PerformPreview(CComBSTR FileName);
protected:
CComBSTR m_sFilename;
CComBSTR sTooltip;
CThumbDialog* Thumb;
};
#endif //__WINREFINESHLEXT_H_