ReactOS  0.4.14-dev-552-g2fad488
contextmenu.h
Go to the documentation of this file.
1 /* Copyright (c) Mark Harmstone 2016-17
2  *
3  * This file is part of WinBtrfs.
4  *
5  * WinBtrfs is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public Licence as published by
7  * the Free Software Foundation, either version 3 of the Licence, or
8  * (at your option) any later version.
9  *
10  * WinBtrfs is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public Licence for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public Licence
16  * along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
17 
18 #pragma once
19 
20 #include <shlobj.h>
21 
22 extern LONG objs_loaded;
23 
25 public:
27  refcount = 0;
28  ignore = true;
29  stgm_set = false;
30  uacicon = nullptr;
31  allow_snapshot = false;
33  }
34 
35  virtual ~BtrfsContextMenu() {
36  if (stgm_set) {
37  GlobalUnlock(stgm.hGlobal);
39  }
40 
41  if (uacicon)
43 
45  }
46 
47  // IUnknown
48 
50 
53  }
54 
57 
58  if (rc == 0)
59  delete this;
60 
61  return rc;
62  }
63 
64  // IShellExtInit
65 
66  virtual HRESULT __stdcall Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject* pdtobj, HKEY hkeyProgID);
67 
68  // IContextMenu
69 
70  virtual HRESULT __stdcall QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
72  virtual HRESULT __stdcall GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT* pwReserved, LPSTR pszName, UINT cchMax);
73 
74 private:
77  bool bg;
78  wstring path;
79  STGMEDIUM stgm;
80  bool stgm_set;
82 
83  void reflink_copy(HWND hwnd, const WCHAR* fn, const WCHAR* dir);
84  void get_uac_icon();
85 };
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define REFIID
Definition: guiddef.h:118
ULONG __stdcall AddRef()
Definition: contextmenu.h:51
static HMENU hmenu
Definition: win.c:66
virtual HRESULT __stdcall QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
virtual HRESULT __stdcall GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT *pwReserved, LPSTR pszName, UINT cchMax)
REFIID riid
Definition: precomp.h:44
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
UINT uFlags
Definition: api.c:59
char * LPSTR
Definition: xmlstorage.h:182
void reflink_copy(HWND hwnd, const WCHAR *fn, const WCHAR *dir)
virtual HRESULT __stdcall InvokeCommand(LPCMINVOKECOMMANDINFO pici)
long LONG
Definition: pedump.c:60
unsigned int dir
Definition: maze.c:112
struct IContextMenu::tagCMINVOKECOMMANDINFO * LPCMINVOKECOMMANDINFO
STGMEDIUM stgm
Definition: contextmenu.h:79
virtual HRESULT __stdcall Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID)
Definition: contextmenu.cpp:85
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define __stdcall
Definition: typedefs.h:25
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
UINT cchMax
#define InterlockedDecrement
Definition: armddk.h:52
#define InterlockedIncrement
Definition: armddk.h:53
ULONG __stdcall Release()
Definition: contextmenu.h:55
unsigned int UINT
Definition: ndis.h:50
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
unsigned int ULONG
Definition: retypes.h:1
HRESULT __stdcall QueryInterface(REFIID riid, void **ppObj)
Definition: contextmenu.cpp:70
static HBITMAP
Definition: button.c:44
LONG objs_loaded
Definition: main.cpp:48
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
virtual ~BtrfsContextMenu()
Definition: contextmenu.h:35