This repository has been archived by the owner on Jul 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Window.h
80 lines (63 loc) · 1.75 KB
/
Window.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
75
76
77
78
79
80
#pragma once
#define WM_ENSURELOADED WM_USER
class Window
{
public:
Window();
static HRESULT Register();
static void Unregister();
HRESULT Create();
void Destroy();
void Enumerate();
private:
static LRESULT CALLBACK StaticWindowProc(HWND, UINT, WPARAM, LPARAM);
LRESULT WindowProc(UINT, WPARAM, LPARAM);
bool OnCreate(CREATESTRUCT*);
void OnSize();
void OnActivate(UINT);
void OnClose();
LRESULT OnNotify(NMHDR*);
void OnLvDblClk(NMITEMACTIVATE*);
void OnLvGetEmptyMarkup(NMLVEMPTYMARKUP*);
void OnLvGetDispInfo(NMLVDISPINFO*);
void OnLvCacheHint(NMLVCACHEHINT*);
void OnLvBeginDrag(NMLISTVIEW*);
HRESULT EnsureCrestLoaded(int);
private:
static const TCHAR CLASSNAME[];
static const COLORREF BGCOLOR;
static const COLORREF FGCOLOR;
static HBRUSH s_brush;
static ATOM s_atom;
HWND m_hWnd;
HWND m_hCtlLv;
CComPtr<IImageList2> m_iml;
vector<CrestPtr> m_crests;
private:
class DropSource : public ComObject<DropSource, IDropSource>
{
public:
STDMETHOD(QueryContinueDrag)(BOOL, DWORD);
STDMETHOD(GiveFeedback)(DWORD);
};
class DataObject : public ComObject<DataObject, IDataObject>
{
public:
DataObject(HWND, vector<CrestPtr>&&, map<Crest*, int>&&);
int GetDataIndex(const FORMATETC*) const;
STDMETHOD(GetData)(FORMATETC*, STGMEDIUM*);
STDMETHOD(GetDataHere)(FORMATETC*, STGMEDIUM*);
STDMETHOD(QueryGetData)(FORMATETC*);
STDMETHOD(GetCanonicalFormatEtc)(FORMATETC*, FORMATETC*);
STDMETHOD(SetData)(FORMATETC*, STGMEDIUM*, BOOL);
STDMETHOD(EnumFormatEtc)(DWORD, IEnumFORMATETC**);
STDMETHOD(DAdvise)(FORMATETC*, DWORD, IAdviseSink*, DWORD*);
STDMETHOD(DUnadvise)(DWORD);
STDMETHOD(EnumDAdvise)(IEnumSTATDATA**);
private:
HWND m_hWnd;
vector<CrestPtr> m_crests;
map<Crest*, int> m_idxmap;
FORMATETC m_fe[2];
};
};