ReactOS  0.4.14-dev-390-g34947ad
CISFBand Class Reference

#include <CISFBand.h>

Inheritance diagram for CISFBand:
Collaboration diagram for CISFBand:

Public Member Functions

 CISFBand ()
 
virtual ~CISFBand ()
 
HRESULT CreateSimpleToolbar (HWND hWndParent)
 
virtual STDMETHODIMP GetSite (IN REFIID riid, OUT void **ppvSite)
 
virtual STDMETHODIMP SetSite (IN IUnknown *pUnkSite)
 
virtual STDMETHODIMP GetWindow (OUT HWND *phwnd)
 
virtual STDMETHODIMP ContextSensitiveHelp (IN BOOL fEnterMode)
 
virtual STDMETHODIMP ShowDW (IN BOOL bShow)
 
virtual STDMETHODIMP CloseDW (IN DWORD dwReserved)
 
virtual STDMETHODIMP ResizeBorderDW (LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved)
 
virtual STDMETHODIMP GetBandInfo (IN DWORD dwBandID, IN DWORD dwViewMode, IN OUT DESKBANDINFO *pdbi)
 
virtual STDMETHODIMP GetClassID (OUT CLSID *pClassID)
 
virtual STDMETHODIMP GetSizeMax (OUT ULARGE_INTEGER *pcbSize)
 
virtual STDMETHODIMP IsDirty ()
 
virtual STDMETHODIMP Load (IN IStream *pStm)
 
virtual STDMETHODIMP Save (IN IStream *pStm, IN BOOL fClearDirty)
 
virtual STDMETHODIMP ContainsWindow (IN HWND hWnd)
 
virtual STDMETHODIMP OnWinEvent (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
 
virtual STDMETHODIMP IsWindowOwner (HWND hWnd)
 
virtual STDMETHODIMP Exec (IN const GUID *pguidCmdGroup, IN DWORD nCmdID, IN DWORD nCmdexecopt, IN VARIANT *pvaIn, IN OUT VARIANT *pvaOut)
 
virtual STDMETHODIMP QueryStatus (IN const GUID *pguidCmdGroup, IN ULONG cCmds, IN OUT OLECMD prgCmds[], IN OUT OLECMDTEXT *pCmdText)
 
virtual STDMETHODIMP GetBandInfoSFB (PBANDINFOSFB pbi)
 
virtual STDMETHODIMP InitializeSFB (IShellFolder *psf, PCIDLIST_ABSOLUTE pidl)
 
virtual STDMETHODIMP SetBandInfoSFB (PBANDINFOSFB pbi)
 
virtual STDMETHODIMP GetCommandString (UINT_PTR idCmd, UINT uFlags, UINT *pwReserved, LPSTR pszName, UINT cchMax)
 
virtual STDMETHODIMP InvokeCommand (LPCMINVOKECOMMANDINFO pici)
 
virtual STDMETHODIMP QueryContextMenu (HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
- Public Member Functions inherited from IObjectWithSite
HRESULT SetSite ([in] IUnknown *pUnkSite)
 
HRESULT GetSite ([in] REFIID riid, [out, iid_is(riid)] PVOID *ppvSite)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
- Public Member Functions inherited from IDeskBand
HRESULT GetBandInfo ([in] DWORD dwBandID, [in] DWORD dwViewMode, [in, out] DESKBANDINFO *pdbi)
 
- Public Member Functions inherited from IDockingWindow
HRESULT ShowDW ([in] BOOL fShow)
 
HRESULT CloseDW ([in] DWORD dwReserved)
 
- Public Member Functions inherited from IOleWindow
HRESULT GetWindow ([out] HWND *phwnd)
 
HRESULT ContextSensitiveHelp ([in] BOOL fEnterMode)
 
- Public Member Functions inherited from IPersistStream
HRESULT Load ([in, unique] IStream *pStm)
 
HRESULT Save ([in, unique] IStream *pStm, [in] BOOL fClearDirty)
 
HRESULT GetSizeMax ([out] ULARGE_INTEGER *pcbSize)
 
- Public Member Functions inherited from IPersist
HRESULT GetClassID ([out] CLSID *pClassID)
 
- Public Member Functions inherited from IOleCommandTarget
HRESULT QueryStatus ([in, unique] const GUID *pguidCmdGroup, [in] ULONG cCmds, [in, out, size_is(cCmds)] OLECMD prgCmds[], [in, out, unique] OLECMDTEXT *pCmdText)
 
HRESULT Exec ([in, unique] const GUID *pguidCmdGroup, [in] DWORD nCmdID, [in] DWORD nCmdexecopt, [in, unique] VARIANT *pvaIn, [in, out, unique] VARIANT *pvaOut)
 

Private Attributes

DWORD m_BandID
 
CComPtr< IUnknownm_Site
 
CComPtr< IShellFolderm_pISF
 
PIDLIST_ABSOLUTE m_pidl
 
BOOL m_textFlag
 
BOOL m_iconFlag
 
BOOL m_QLaunch
 

Additional Inherited Members

- Public Types inherited from IObjectWithSite
typedef IObjectWithSiteLPOBJECTWITHSITE
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IOleWindow
typedef IOleWindowLPOLEWINDOW
 
- Public Types inherited from IPersistStream
typedef IPersistStreamLPPERSISTSTREAM
 
- Public Types inherited from IPersist
typedef IPersistLPPERSIST
 
- Public Types inherited from IOleCommandTarget
enum  OLECMDF {
  OLECMDF_SUPPORTED = 0x1, OLECMDF_ENABLED = 0x2, OLECMDF_LATCHED = 0x4, OLECMDF_NINCHED = 0x8,
  OLECMDF_INVISIBLE = 0x10, OLECMDF_DEFHIDEONCTXTMENU = 0x20
}
 
enum  OLECMDTEXTF { OLECMDTEXTF_NONE = 0, OLECMDTEXTF_NAME = 1, OLECMDTEXTF_STATUS = 2 }
 
enum  OLECMDEXECOPT { OLECMDEXECOPT_DODEFAULT = 0, OLECMDEXECOPT_PROMPTUSER = 1, OLECMDEXECOPT_DONTPROMPTUSER = 2, OLECMDEXECOPT_SHOWHELP = 3 }
 
enum  OLECMDID {
  OLECMDID_OPEN = 1, OLECMDID_NEW = 2, OLECMDID_SAVE = 3, OLECMDID_SAVEAS = 4,
  OLECMDID_SAVECOPYAS = 5, OLECMDID_PRINT = 6, OLECMDID_PRINTPREVIEW = 7, OLECMDID_PAGESETUP = 8,
  OLECMDID_SPELL = 9, OLECMDID_PROPERTIES = 10, OLECMDID_CUT = 11, OLECMDID_COPY = 12,
  OLECMDID_PASTE = 13, OLECMDID_PASTESPECIAL = 14, OLECMDID_UNDO = 15, OLECMDID_REDO = 16,
  OLECMDID_SELECTALL = 17, OLECMDID_CLEARSELECTION = 18, OLECMDID_ZOOM = 19, OLECMDID_GETZOOMRANGE = 20,
  OLECMDID_UPDATECOMMANDS = 21, OLECMDID_REFRESH = 22, OLECMDID_STOP = 23, OLECMDID_HIDETOOLBARS = 24,
  OLECMDID_SETPROGRESSMAX = 25, OLECMDID_SETPROGRESSPOS = 26, OLECMDID_SETPROGRESSTEXT = 27, OLECMDID_SETTITLE = 28,
  OLECMDID_SETDOWNLOADSTATE = 29, OLECMDID_STOPDOWNLOAD = 30, OLECMDID_ONTOOLBARACTIVATED = 31, OLECMDID_FIND = 32,
  OLECMDID_DELETE = 33, OLECMDID_HTTPEQUIV = 34, OLECMDID_HTTPEQUIV_DONE = 35, OLECMDID_ENABLE_INTERACTION = 36,
  OLECMDID_ONUNLOAD = 37, OLECMDID_PROPERTYBAG2 = 38, OLECMDID_PREREFRESH = 39, OLECMDID_SHOWSCRIPTERROR = 40,
  OLECMDID_SHOWMESSAGE = 41, OLECMDID_SHOWFIND = 42, OLECMDID_SHOWPAGESETUP = 43, OLECMDID_SHOWPRINT = 44,
  OLECMDID_CLOSE = 45, OLECMDID_ALLOWUILESSSAVEAS = 46, OLECMDID_DONTDOWNLOADCSS = 47, OLECMDID_UPDATEPAGESTATUS = 48,
  OLECMDID_PRINT2 = 49, OLECMDID_PRINTPREVIEW2 = 50, OLECMDID_SETPRINTTEMPLATE = 51, OLECMDID_GETPRINTTEMPLATE = 52,
  OLECMDID_PAGEACTIONBLOCKED = 55, OLECMDID_PAGEACTIONUIQUERY = 56, OLECMDID_FOCUSVIEWCONTROLS = 57, OLECMDID_FOCUSVIEWCONTROLSQUERY = 58,
  OLECMDID_SHOWPAGEACTIONMENU = 59, OLECMDID_ADDTRAVELENTRY = 60, OLECMDID_UPDATETRAVELENTRY = 61, OLECMDID_UPDATEBACKFORWARDSTATE = 62,
  OLECMDID_OPTICAL_ZOOM = 63, OLECMDID_OPTICAL_GETZOOMRANGE = 64, OLECMDID_WINDOWSTATECHANGED = 65, OLECMDID_ACTIVEXINSTALLSCOPE = 66,
  OLECMDID_UPDATETRAVELENTRY_DATARECOVERY = 67, OLECMDID_SHOWTASKDLG = 68, OLECMDID_POPSTATEEVENT = 69, OLECMDID_VIEWPORT_MODE = 70,
  OLECMDID_LAYOUT_VIEWPORT_WIDTH = 71, OLECMDID_VISUAL_VIEWPORT_EXCLUDE_BOTTOM = 72, OLECMDID_USER_OPTICAL_ZOOM = 73, OLECMDID_PAGEAVAILABLE = 74,
  OLECMDID_GETUSERSCALABLE = 75, OLECMDID_UPDATE_CARET = 76, OLECMDID_ENABLE_VISIBILITY = 77, OLECMDID_MEDIA_PLAYBACK = 78
}
 
typedef IOleCommandTargetLPOLECOMMANDTARGET
 
typedef enum IOleCommandTarget::OLECMDF OLECMDF
 
typedef struct IOleCommandTarget::_tagOLECMD OLECMD
 
typedef struct IOleCommandTarget::_tagOLECMDTEXT OLECMDTEXT
 
typedef enum IOleCommandTarget::OLECMDTEXTF OLECMDTEXTF
 
typedef enum IOleCommandTarget::OLECMDEXECOPT OLECMDEXECOPT
 
typedef enum IOleCommandTarget::OLECMDID OLECMDID
 
- Public Types inherited from IContextMenu
typedef struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
 
typedef struct IContextMenu::tagCMINVOKECOMMANDINFOLPCMINVOKECOMMANDINFO
 
typedef struct IContextMenu::tagCMInvokeCommandInfoEx CMINVOKECOMMANDINFOEX
 
typedef struct IContextMenu::tagCMInvokeCommandInfoExLPCMINVOKECOMMANDINFOEX
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Public Attributes inherited from IContextMenu
CMIC_MASK_NOZONECHECKS typedef IContextMenuLPCONTEXTMENU
 
- Static Public Attributes inherited from IContextMenu
static CMDSTR_VIEWDETAILSW(const WCHAR []) const WCHAR CMDSTR_NEWFOLDERW [] = {'N','e','w','F','o','l','d','e','r',0}
 
static const WCHAR CMDSTR_VIEWLISTW [] = {'V','i','e','w','L','i','s','t',0}
 
static const WCHAR CMDSTR_VIEWDETAILSW [] = {'V','i','e','w','D','e','t','a','i','l','s',0}
 

Detailed Description

Definition at line 11 of file CISFBand.h.

Constructor & Destructor Documentation

◆ CISFBand()

CISFBand::CISFBand ( )

Definition at line 28 of file CISFBand.cpp.

28  :
29  m_BandID(0),
30  m_pidl(NULL),
31  m_textFlag(true),
32  m_iconFlag(true),
33  m_QLaunch(false)
34 {
35 }
PIDLIST_ABSOLUTE m_pidl
Definition: CISFBand.h:29
DWORD m_BandID
Definition: CISFBand.h:24
smooth NULL
Definition: ftsmooth.c:416
BOOL m_textFlag
Definition: CISFBand.h:32
BOOL m_QLaunch
Definition: CISFBand.h:34
BOOL m_iconFlag
Definition: CISFBand.h:33

◆ ~CISFBand()

CISFBand::~CISFBand ( )
virtual

Definition at line 37 of file CISFBand.cpp.

38 {
39  CloseDW(0);
40 }
virtual STDMETHODIMP CloseDW(IN DWORD dwReserved)
Definition: CISFBand.cpp:182

Member Function Documentation

◆ CloseDW()

STDMETHODIMP CISFBand::CloseDW ( IN DWORD  dwReserved)
virtual

Definition at line 182 of file CISFBand.cpp.

183  {
184  if (m_hWnd)
185  {
187 
188  TBBUTTON tb;
189  for (int i = 0; SendMessage(m_hWnd, TB_GETBUTTON, i, (LPARAM)&tb); i++)
190  {
191  CoTaskMemFree((LPITEMIDLIST)tb.dwData);
192  }
193 
194  DestroyWindow();
195  m_hWnd = NULL;
196  return S_OK;
197  }
198 
199  return E_FAIL;
200  }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
#define SW_HIDE
Definition: winuser.h:762
#define TB_GETBUTTON
Definition: commctrl.h:1105
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define E_FAIL
Definition: ddrawi.h:102
BOOL WINAPI DestroyWindow(_In_ HWND)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
static const WCHAR tb[]
Definition: suminfo.c:286
#define S_OK
Definition: intsafe.h:59
#define SendMessage
Definition: winuser.h:5744
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

Referenced by ~CISFBand().

◆ ContainsWindow()

STDMETHODIMP CISFBand::ContainsWindow ( IN HWND  hWnd)
virtual

Definition at line 323 of file CISFBand.cpp.

324  {
325  if (hWnd == m_hWnd || IsChild(hWnd))
326  {
327  TRACE("CISFBand::ContainsWindow(0x%p) returns S_OK\n", hWnd);
328  return S_OK;
329  }
330 
331  return S_FALSE;
332  }
HWND hWnd
Definition: settings.c:17
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)

◆ ContextSensitiveHelp()

STDMETHODIMP CISFBand::ContextSensitiveHelp ( IN BOOL  fEnterMode)
virtual

Definition at line 165 of file CISFBand.cpp.

166  {
167  /* FIXME: Implement */
168  return E_NOTIMPL;
169  }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ CreateSimpleToolbar()

HRESULT CISFBand::CreateSimpleToolbar ( HWND  hWndParent)

Definition at line 54 of file CISFBand.cpp.

55 {
56  // Declare and initialize local constants.
57  const DWORD buttonStyles = BTNS_AUTOSIZE;
58 
59  // Create the toolbar.
62  hWndParent, NULL, 0, NULL);
63  if (m_hWnd == NULL)
64  return E_FAIL;
65 
66  if (!m_textFlag)
68 
69  // Set the image list.
70  HIMAGELIST* piml;
71  HRESULT hr = SHGetImageList(SHIL_SMALL, IID_IImageList, (void**)&piml);
73  {
74  DestroyWindow();
75  return hr;
76  }
77  SendMessage(m_hWnd, TB_SETIMAGELIST, 0, (LPARAM)piml);
78 
79  // Enumerate objects
80  CComPtr<IEnumIDList> pEndl;
81  LPITEMIDLIST pidl;
82  STRRET stret;
83  hr = m_pISF->EnumObjects(0, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS, &pEndl);
84  if (FAILED_UNEXPECTEDLY(hr))
85  {
86  DestroyWindow();
87  return hr;
88  }
89 
90  for (int i=0; pEndl->Next(1, &pidl, NULL) != S_FALSE; i++)
91  {
92  WCHAR sz[MAX_PATH];
94  hr = m_pISF->GetDisplayNameOf(pidl, SHGDN_NORMAL, &stret);
96  {
97  StringCchCopyW(sz, MAX_PATH, L"<Unknown-Name>");
98  }
99  else
100  StrRetToBuf(&stret, pidl, sz, _countof(sz));
101 
102  TBBUTTON tb = { MAKELONG(index, 0), i, TBSTATE_ENABLED, buttonStyles,{ 0 }, (DWORD_PTR)pidl, (INT_PTR)sz };
103  SendMessage(m_hWnd, TB_INSERTBUTTONW, i, (LPARAM)&tb);
104  }
105 
106  // Resize the toolbar, and then show it.
107  SendMessage(m_hWnd, TB_AUTOSIZE, 0, 0);
108 
109  return hr;
110 }
#define DWORD_PTR
Definition: treelist.c:76
HRESULT hr
Definition: shlfolder.c:183
#define _countof(array)
Definition: fontsub.cpp:30
CComPtr< IShellFolder > m_pISF
Definition: CISFBand.h:28
#define BTNS_AUTOSIZE
Definition: commctrl.h:1000
#define WS_CHILD
Definition: pedump.c:617
int32_t INT_PTR
Definition: typedefs.h:62
#define E_FAIL
Definition: ddrawi.h:102
BOOL WINAPI DestroyWindow(_In_ HWND)
#define CCS_NODIVIDER
Definition: commctrl.h:2244
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define TB_AUTOSIZE
Definition: commctrl.h:1133
HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
Definition: shellord.c:2013
#define StrRetToBuf
Definition: shlwapi.h:1769
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
#define CreateWindowEx
Definition: winuser.h:5656
#define CW_USEDEFAULT
Definition: winuser.h:225
#define S_FALSE
Definition: winerror.h:2357
#define TOOLBARCLASSNAME
Definition: commctrl.h:942
#define MAKELONG(a, b)
Definition: typedefs.h:248
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
GLuint index
Definition: glext.h:6031
BOOL m_textFlag
Definition: CISFBand.h:32
#define TB_SETIMAGELIST
Definition: commctrl.h:1146
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR tb[]
Definition: suminfo.c:286
#define CCS_NORESIZE
Definition: commctrl.h:2241
static const WCHAR L[]
Definition: oid.c:1250
#define TB_INSERTBUTTONW
Definition: commctrl.h:1261
#define SendMessage
Definition: winuser.h:5744
int WINAPI SHMapPIDLToSystemImageListIndex(IShellFolder *sh, LPCITEMIDLIST pidl, int *pIndex)
Definition: iconcache.cpp:789
#define TBSTATE_ENABLED
Definition: commctrl.h:970
#define TBSTYLE_EX_MIXEDBUTTONS
Definition: commctrl.h:1008
#define SHIL_SMALL
Definition: shellapi.h:183
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define TBSTYLE_LIST
Definition: commctrl.h:989
#define TBSTYLE_FLAT
Definition: commctrl.h:988
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1186

Referenced by SetSite().

◆ Exec()

STDMETHODIMP CISFBand::Exec ( IN const GUID pguidCmdGroup,
IN DWORD  nCmdID,
IN DWORD  nCmdexecopt,
IN VARIANT pvaIn,
IN OUT VARIANT pvaOut 
)
virtual

Definition at line 431 of file CISFBand.cpp.

432  {
433  if (IsEqualIID(*pguidCmdGroup, IID_IBandSite))
434  {
435  return S_OK;
436  }
437 
438  if (IsEqualIID(*pguidCmdGroup, IID_IDeskBand))
439  {
440  if (nCmdID == DBID_SETWINDOWTHEME)
441  {
442  if (pvaIn && V_VT(pvaIn) == VT_BSTR && V_BSTR(pvaIn))
443  {
444  SetWindowTheme(m_hWnd, V_BSTR(pvaIn), NULL);
445  }
446  }
447  return S_OK;
448  }
449 
451 
452  return E_NOTIMPL;
453  }
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
smooth NULL
Definition: ftsmooth.c:416
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
#define UNIMPLEMENTED
Definition: debug.h:114
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ GetBandInfo()

STDMETHODIMP CISFBand::GetBandInfo ( IN DWORD  dwBandID,
IN DWORD  dwViewMode,
IN OUT DESKBANDINFO pdbi 
)
virtual

Definition at line 209 of file CISFBand.cpp.

210  {
211  TRACE("CTaskBand::GetBandInfo(0x%x,0x%x,0x%p) hWnd=0x%p\n", dwBandID, dwViewMode, pdbi, m_hWnd);
212 
213  if (m_hWnd && pdbi)
214  {
215  m_BandID = dwBandID;
216 
217  RECT actualRect;
218  POINTL actualSize;
219  POINTL idealSize;
220  POINTL maxSize;
221  POINTL itemSize;
222 
223  GetWindowRect(&actualRect);
224  actualSize.x = actualRect.right - actualRect.left;
225  actualSize.y = actualRect.bottom - actualRect.top;
226 
227  // Obtain the ideal size, to be used as min and max
228  SendMessageW(m_hWnd, TB_AUTOSIZE, 0, 0);
229  SendMessageW(m_hWnd, TB_GETMAXSIZE, 0, reinterpret_cast<LPARAM>(&maxSize));
230 
231  idealSize = maxSize;
232  SendMessageW(m_hWnd, TB_GETIDEALSIZE, FALSE, reinterpret_cast<LPARAM>(&idealSize));
233 
234  // Obtain the button size, to be used as the integral size
235  DWORD size = SendMessageW(m_hWnd, TB_GETBUTTONSIZE, 0, 0);
236  itemSize.x = GET_X_LPARAM(size);
237  itemSize.y = GET_Y_LPARAM(size);
238 
239  if (pdbi->dwMask & DBIM_MINSIZE)
240  {
241  if (m_QLaunch)
242  pdbi->ptMinSize.x = idealSize.x;
243  else
244  pdbi->ptMinSize.x = -1;
245  pdbi->ptMinSize.y = idealSize.y;
246  }
247  if (pdbi->dwMask & DBIM_MAXSIZE)
248  {
249  pdbi->ptMaxSize = maxSize;
250  }
251  if (pdbi->dwMask & DBIM_INTEGRAL)
252  {
253  pdbi->ptIntegral = itemSize;
254  }
255  if (pdbi->dwMask & DBIM_ACTUAL)
256  {
257  pdbi->ptActual = actualSize;
258  }
259  if (pdbi->dwMask & DBIM_TITLE)
260  {
261  if (m_QLaunch || !ILGetDisplayNameEx(NULL, m_pidl, pdbi->wszTitle, ILGDN_INFOLDER))
262  {
263  pdbi->dwMask &= ~DBIM_TITLE;
264  }
265  }
266  if (pdbi->dwMask & DBIM_MODEFLAGS)
267  {
268  pdbi->dwModeFlags = DBIMF_NORMAL | DBIMF_VARIABLEHEIGHT | DBIMF_USECHEVRON | DBIMF_NOMARGINS | DBIMF_BKCOLOR;
269  if (m_QLaunch)
270  {
271  pdbi->dwModeFlags |= DBIMF_ADDTOFRONT;
272  }
273  }
274  if (pdbi->dwMask & DBIM_BKCOLOR)
275  pdbi->dwMask &= ~DBIM_BKCOLOR;
276 
277  return S_OK;
278  }
279 
280  return E_FAIL;
281  }
LONG top
Definition: windef.h:292
PIDLIST_ABSOLUTE m_pidl
Definition: CISFBand.h:29
#define GET_X_LPARAM(lp)
Definition: windowsx.h:274
DWORD m_BandID
Definition: CISFBand.h:24
LONG left
Definition: windef.h:291
#define TB_GETMAXSIZE
Definition: commctrl.h:1185
LONG right
Definition: windef.h:293
#define E_FAIL
Definition: ddrawi.h:102
LONG y
Definition: windef.h:315
#define TB_AUTOSIZE
Definition: commctrl.h:1133
smooth NULL
Definition: ftsmooth.c:416
#define TB_GETIDEALSIZE
Definition: commctrl.h:1280
#define TB_GETBUTTONSIZE
Definition: commctrl.h:1156
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG x
Definition: windef.h:314
BOOL m_QLaunch
Definition: CISFBand.h:34
#define ILGDN_INFOLDER
Definition: undocshell.h:70
#define S_OK
Definition: intsafe.h:59
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI ILGetDisplayNameEx(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPVOID path, DWORD type)
Definition: pidl.c:162
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:275
LONG bottom
Definition: windef.h:294
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

◆ GetBandInfoSFB()

STDMETHODIMP CISFBand::GetBandInfoSFB ( PBANDINFOSFB  pbi)
virtual

Definition at line 457 of file CISFBand.cpp.

458  {
459  if (pbi->dwMask == ISFB_MASK_IDLIST)
460  {
461  pbi->pidl = ILClone(m_pidl);
462  if (!pbi->pidl)
463  return E_OUTOFMEMORY;
464  return S_OK;
465  }
466 
467  return E_NOTIMPL;
468  }
PIDLIST_ABSOLUTE m_pidl
Definition: CISFBand.h:29
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
_Inout_ PERBANDINFO * pbi
Definition: winddi.h:3917
#define S_OK
Definition: intsafe.h:59
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
#define E_NOTIMPL
Definition: ddrawi.h:99
#define ISFB_MASK_IDLIST
Definition: shlobj.h:2554

◆ GetClassID()

STDMETHODIMP CISFBand::GetClassID ( OUT CLSID pClassID)
virtual

Definition at line 285 of file CISFBand.cpp.

286  {
287  *pClassID = CLSID_ISFBand;
288 
289  return S_OK;
290  }
#define S_OK
Definition: intsafe.h:59

◆ GetCommandString()

STDMETHODIMP CISFBand::GetCommandString ( UINT_PTR  idCmd,
UINT  uFlags,
UINT pwReserved,
LPSTR  pszName,
UINT  cchMax 
)
virtual

Implements IContextMenu.

Definition at line 535 of file CISFBand.cpp.

536  {
537  /*HRESULT hr = E_INVALIDARG;
538 
539  if (idCmd == IDM_DISPLAY)
540  {
541  switch (uFlags)
542  {
543  case GCS_HELPTEXTW:
544  // Only useful for pre-Vista versions of Windows that
545  // have a Status bar.
546  hr = StringCchCopyW(reinterpret_cast<PWSTR>(pszName),
547  cchMax,
548  L"Display File Name");
549  break;
550 
551  case GCS_VERBW:
552  // GCS_VERBW is an optional feature that enables a caller
553  // to discover the canonical name for the verb that is passed in
554  // through idCommand.
555  hr = StringCchCopyW(reinterpret_cast<PWSTR>(pszName),
556  cchMax,
557  L"DisplayFileName");
558  break;
559  }
560  }
561  return hr; */
562 
563  return S_OK;
564  }
#define S_OK
Definition: intsafe.h:59

◆ GetSite()

STDMETHODIMP CISFBand::GetSite ( IN REFIID  riid,
OUT void **  ppvSite 
)
virtual

Definition at line 137 of file CISFBand.cpp.

138  {
139  TRACE("CISFBand::GetSite(0x%p,0x%p)\n", riid, ppvSite);
140 
141  HRESULT hr;
142  if (m_Site != NULL)
143  {
144  hr = m_Site->QueryInterface(riid, ppvSite);
145  if (FAILED(hr)) return hr;
146  }
147 
148  *ppvSite = NULL;
149  return E_FAIL;
150  }
CComPtr< IUnknown > m_Site
Definition: CISFBand.h:25
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
#define E_FAIL
Definition: ddrawi.h:102
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77

◆ GetSizeMax()

STDMETHODIMP CISFBand::GetSizeMax ( OUT ULARGE_INTEGER pcbSize)
virtual

Definition at line 314 of file CISFBand.cpp.

315  {
316  TRACE("CISFBand::GetSizeMax called\n");
317 
318  return S_OK;
319  }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ GetWindow()

STDMETHODIMP CISFBand::GetWindow ( OUT HWND phwnd)
virtual

Definition at line 154 of file CISFBand.cpp.

155  {
156  if (!m_hWnd)
157  return E_FAIL;
158  if (!phwnd)
159  return E_POINTER;
160  *phwnd = m_hWnd;
161 
162  return S_OK;
163  }
#define E_FAIL
Definition: ddrawi.h:102
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ InitializeSFB()

STDMETHODIMP CISFBand::InitializeSFB ( IShellFolder psf,
PCIDLIST_ABSOLUTE  pidl 
)
virtual

Definition at line 470 of file CISFBand.cpp.

471  {
472  HRESULT hr;
473 
474  if (!psf && !pidl)
475  return E_INVALIDARG;
476 
477  if (psf && pidl)
478  return E_INVALIDARG;
479 
480  if (pidl != NULL)
481  {
482  CComPtr<IShellFolder> psfDesktop;
483  hr = SHGetDesktopFolder(&psfDesktop);
484  if (FAILED_UNEXPECTEDLY(hr))
485  return hr;
486 
487  if (_ILIsDesktop(pidl))
488  {
489  m_pISF = psfDesktop;
490  }
491  else
492  {
493  hr = psfDesktop->BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder, &m_pISF));
494  if (FAILED_UNEXPECTEDLY(hr))
495  return hr;
496  }
497 
498  m_pidl = ILClone(pidl);
499  }
500 
501  if (psf != NULL)
502  {
503  CComPtr<IPersistFolder2> ppf2;
505  if (FAILED_UNEXPECTEDLY(hr))
506  return hr;
507 
508  hr = ppf2->GetCurFolder(&m_pidl);
509  if (FAILED_UNEXPECTEDLY(hr))
510  return hr;
511 
512  m_pISF = psf;
513  }
514 
515  return S_OK;
516  }
HRESULT hr
Definition: shlfolder.c:183
PIDLIST_ABSOLUTE m_pidl
Definition: CISFBand.h:29
CComPtr< IShellFolder > m_pISF
Definition: CISFBand.h:28
#define IID_PPV_ARG(Itype, ppType)
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define S_OK
Definition: intsafe.h:59
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)

◆ InvokeCommand()

STDMETHODIMP CISFBand::InvokeCommand ( LPCMINVOKECOMMANDINFO  pici)
virtual

Implements IContextMenu.

Definition at line 566 of file CISFBand.cpp.

567  {
568  if (!HIWORD(pici->lpVerb))
569  {
570  switch (LOWORD(pici->lpVerb))
571  {
572  case IDM_LARGE_ICONS:
573  {
574  m_iconFlag = false;
575 
576  HIMAGELIST* piml = (HIMAGELIST*) SendMessage(m_hWnd, TB_GETIMAGELIST, 0, 0);
577  HRESULT hr = SHGetImageList(SHIL_LARGE, IID_IImageList, (void**)&piml);
578  if (FAILED_UNEXPECTEDLY(hr)) return hr;
579  SendMessage(m_hWnd, TB_SETIMAGELIST, 0, (LPARAM)piml);
580  hr = IUnknown_Exec(m_Site, IID_IDeskBand, DBID_BANDINFOCHANGED, 0, NULL, NULL);
581  if (FAILED_UNEXPECTEDLY(hr)) return hr;
582  break;
583  }
584  case IDM_SMALL_ICONS:
585  {
586  m_iconFlag = true;
587 
588  HIMAGELIST* piml = (HIMAGELIST*)SendMessage(m_hWnd, TB_GETIMAGELIST, 0, 0);
589  HRESULT hr = SHGetImageList(SHIL_SMALL, IID_IImageList, (void**)&piml);
590  if (FAILED_UNEXPECTEDLY(hr)) return hr;
591  SendMessage(m_hWnd, TB_SETIMAGELIST, 0, (LPARAM)piml);
592  hr = IUnknown_Exec(m_Site, IID_IDeskBand, DBID_BANDINFOCHANGED, 0, NULL, NULL);
593  if (FAILED_UNEXPECTEDLY(hr)) return hr;
594  break;
595  }
596  case IDM_OPEN_FOLDER:
597  {
598  SHELLEXECUTEINFO shexinfo;
599 
600  memset(&shexinfo, 0x0, sizeof(shexinfo));
601 
602  shexinfo.cbSize = sizeof(shexinfo);
603  shexinfo.fMask = SEE_MASK_IDLIST;
604  shexinfo.lpVerb = _T("open");
605  shexinfo.lpIDList = m_pidl;
606  shexinfo.nShow = SW_SHOW;
607 
608  if (!ShellExecuteEx(&shexinfo))
609  return E_FAIL;
610 
611  break;
612  }
613  case IDM_SHOW_TEXT:
614  {
615  if (m_textFlag)
616  {
617  m_textFlag = false;
619  HRESULT hr = IUnknown_Exec(m_Site, IID_IDeskBand, DBID_BANDINFOCHANGED, 0, NULL, NULL);
620  if (FAILED_UNEXPECTEDLY(hr)) return hr;
621  }
622  else
623  {
624  m_textFlag = true;
625  SendMessage(m_hWnd, TB_SETEXTENDEDSTYLE, 0, 0);
626  HRESULT hr = IUnknown_Exec(m_Site, IID_IDeskBand, DBID_BANDINFOCHANGED, 0, NULL, NULL);
627  if (FAILED_UNEXPECTEDLY(hr)) return hr;
628  }
629  break;
630  }
631  default:
632  return E_FAIL;
633  }
634  }
635 
636  return S_OK;
637  }
#define SHIL_LARGE
Definition: shellapi.h:182
CComPtr< IUnknown > m_Site
Definition: CISFBand.h:25
#define ShellExecuteEx
Definition: shellapi.h:690
HRESULT hr
Definition: shlfolder.c:183
GLint x0
Definition: linetemp.h:95
PIDLIST_ABSOLUTE m_pidl
Definition: CISFBand.h:29
#define TB_GETIMAGELIST
Definition: commctrl.h:1147
#define E_FAIL
Definition: ddrawi.h:102
HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
Definition: shellord.c:2013
smooth NULL
Definition: ftsmooth.c:416
#define IDM_OPEN_FOLDER
Definition: resource.h:72
LONG_PTR LPARAM
Definition: windef.h:208
BOOL m_textFlag
Definition: CISFBand.h:32
#define SW_SHOW
Definition: winuser.h:769
#define IDM_SMALL_ICONS
Definition: resource.h:69
#define TB_SETIMAGELIST
Definition: commctrl.h:1146
#define _T(x)
Definition: vfdio.h:22
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define S_OK
Definition: intsafe.h:59
BOOL m_iconFlag
Definition: CISFBand.h:33
#define SEE_MASK_IDLIST
Definition: shellapi.h:27
#define SendMessage
Definition: winuser.h:5744
#define HIWORD(l)
Definition: typedefs.h:246
#define TBSTYLE_EX_MIXEDBUTTONS
Definition: commctrl.h:1008
#define IDM_LARGE_ICONS
Definition: resource.h:68
#define SHIL_SMALL
Definition: shellapi.h:183
#define memset(x, y, z)
Definition: compat.h:39
#define LOWORD(l)
Definition: pedump.c:82
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1186
#define IDM_SHOW_TEXT
Definition: resource.h:70
HRESULT WINAPI IUnknown_Exec(IUnknown *lpUnknown, REFGUID pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: ordinal.c:1034

◆ IsDirty()

STDMETHODIMP CISFBand::IsDirty ( void  )
virtual

Implements IPersistStream.

Definition at line 292 of file CISFBand.cpp.

293  {
294  /* The object hasn't changed since the last save! */
295 
296  return S_FALSE;
297  }
#define S_FALSE
Definition: winerror.h:2357

◆ IsWindowOwner()

STDMETHODIMP CISFBand::IsWindowOwner ( HWND  hWnd)
virtual

Definition at line 417 of file CISFBand.cpp.

418  {
419  return (hWnd == m_hWnd) ? S_OK : S_FALSE;
420  }
HWND hWnd
Definition: settings.c:17
#define S_FALSE
Definition: winerror.h:2357
#define S_OK
Definition: intsafe.h:59

◆ Load()

STDMETHODIMP CISFBand::Load ( IN IStream pStm)
virtual

Definition at line 299 of file CISFBand.cpp.

300  {
301  TRACE("CISFBand::Load called\n");
302  /* Nothing to do */
303 
304  return S_OK;
305  }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ OnWinEvent()

STDMETHODIMP CISFBand::OnWinEvent ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
LRESULT theResult 
)
virtual

Definition at line 334 of file CISFBand.cpp.

335  {
336  switch (uMsg)
337  {
338  case WM_COMMAND:
339  {
340  TBBUTTON tb;
341  bool chk = SendMessage(m_hWnd, TB_GETBUTTON, LOWORD(wParam), (LPARAM)&tb);
342  if (chk)
343  SHInvokeDefaultCommand(m_hWnd, m_pISF, (LPITEMIDLIST)tb.dwData);
344 
345  if (theResult)
346  *theResult = TRUE;
347  break;
348  }
349  case WM_NOTIFY:
350  {
351  switch (((LPNMHDR)lParam)->code)
352  {
353  case NM_RCLICK:
354  {
355  HRESULT hr;
356  POINT pt = ((LPNMMOUSE)lParam)->pt;
357  CComPtr<IContextMenu> picm;
358  HMENU fmenu = CreatePopupMenu();
359  TBBUTTON tb;
360 
361  bool chk = SendMessage(m_hWnd, TB_GETBUTTON, ((LPNMMOUSE)lParam)->dwItemSpec, (LPARAM)&tb);
362  LPITEMIDLIST pidl = (LPITEMIDLIST)tb.dwData;
363 
364  if (chk)
365  {
366  ClientToScreen(&pt);
367  hr = m_pISF->GetUIObjectOf(m_hWnd, 1, &pidl, IID_NULL_PPV_ARG(IContextMenu, &picm));
368  if (FAILED_UNEXPECTEDLY(hr))
369  return hr;
370 
371  hr = picm->QueryContextMenu(fmenu, 0, 1, 0x7FFF, CMF_DEFAULTONLY);
372  if (FAILED_UNEXPECTEDLY(hr))
373  return hr;
374 
375  int id = TrackPopupMenuEx(fmenu, TPM_LEFTALIGN | TPM_BOTTOMALIGN | TPM_RETURNCMD, pt.x, pt.y, m_hWnd, 0);
376  if (id > 0)
377  {
378  CMINVOKECOMMANDINFOEX info = { 0 };
379  info.cbSize = sizeof(info);
380  info.fMask = CMIC_MASK_PTINVOKE;
381  if (GetKeyState(VK_CONTROL) < 0)
382  {
383  info.fMask |= CMIC_MASK_CONTROL_DOWN;
384  }
385  if (GetKeyState(VK_SHIFT) < 0)
386  {
387  info.fMask |= CMIC_MASK_SHIFT_DOWN;
388  }
389  info.hwnd = m_hWnd;
390  info.lpVerb = MAKEINTRESOURCEA(id - 1);
391  info.nShow = SW_SHOWNORMAL;
392  info.ptInvoke = pt;
393  picm->InvokeCommand((LPCMINVOKECOMMANDINFO)&info);
394  }
395  }
396  DestroyMenu(fmenu);
397 
398  if (theResult)
399  *theResult = TRUE;
400  break;
401  }
402  default:
403  if (theResult)
404  *theResult = FALSE;
405  }
406 
407  break;
408  }
409  default:
410  if (theResult)
411  *theResult = FALSE;
412  }
413 
414  return S_OK;
415  }
#define TRUE
Definition: types.h:120
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
HRESULT hr
Definition: shlfolder.c:183
#define pt(x, y)
Definition: drawing.c:79
#define TPM_LEFTALIGN
Definition: winuser.h:2352
#define TB_GETBUTTON
Definition: commctrl.h:1105
#define TPM_RETURNCMD
Definition: winuser.h:2362
HRESULT WINAPI SHInvokeDefaultCommand(HWND hWnd, IShellFolder *lpFolder, LPCITEMIDLIST lpApidl)
Definition: ordinal.c:2928
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
CComPtr< IShellFolder > m_pISF
Definition: CISFBand.h:28
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
WPARAM wParam
Definition: combotst.c:138
struct _test_info info[]
Definition: SetCursorPos.c:19
struct tagNMMOUSE * LPNMMOUSE
#define VK_SHIFT
Definition: winuser.h:2177
#define TPM_BOTTOMALIGN
Definition: winuser.h:2360
LONG_PTR LPARAM
Definition: windef.h:208
struct IContextMenu::tagCMINVOKECOMMANDINFO * LPCMINVOKECOMMANDINFO
SHORT WINAPI GetKeyState(_In_ int)
#define IID_NULL_PPV_ARG(Itype, ppType)
if(!(yy_init))
Definition: macro.lex.yy.c:714
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
static const WCHAR tb[]
Definition: suminfo.c:286
#define WM_COMMAND
Definition: winuser.h:1722
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define S_OK
Definition: intsafe.h:59
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define NM_RCLICK
Definition: commctrl.h:133
struct IContextMenu::tagCMInvokeCommandInfoEx CMINVOKECOMMANDINFOEX
#define VK_CONTROL
Definition: winuser.h:2178
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:846
#define SendMessage
Definition: winuser.h:5744
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61

◆ QueryContextMenu()

STDMETHODIMP CISFBand::QueryContextMenu ( HMENU  hmenu,
UINT  indexMenu,
UINT  idCmdFirst,
UINT  idCmdLast,
UINT  uFlags 
)
virtual

Implements IContextMenu.

Definition at line 639 of file CISFBand.cpp.

640  {
641  HMENU qMenu = LoadMenu(GetModuleHandleW(L"browseui.dll"), MAKEINTRESOURCE(IDM_POPUPMENU));
642 
643  if(m_textFlag)
645  else
647 
648  if (m_iconFlag)
649  {
652  }
653  else
654  {
657  }
658 
659  if (_ILIsDesktop(m_pidl))
661 
662  UINT idMax = Shell_MergeMenus(hmenu, GetSubMenu(qMenu, 0), indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS);
663  DestroyMenu(qMenu);
664  return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(idMax - idCmdFirst +1));
665  }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define MF_BYCOMMAND
Definition: winuser.h:202
UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
Definition: shlmenu.c:857
static HMENU hmenu
Definition: win.c:66
PIDLIST_ABSOLUTE m_pidl
Definition: CISFBand.h:29
#define SEVERITY_SUCCESS
Definition: winerror.h:64
#define IDM_POPUPMENU
Definition: resource.h:67
#define IDM_OPEN_FOLDER
Definition: resource.h:72
BOOL m_textFlag
Definition: CISFBand.h:32
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
Definition: CBandSite.h:24
#define MF_CHECKED
Definition: winuser.h:132
#define IDM_SMALL_ICONS
Definition: resource.h:69
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
static const WCHAR L[]
Definition: oid.c:1250
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define MF_UNCHECKED
Definition: winuser.h:204
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define LoadMenu
Definition: winuser.h:5718
unsigned short USHORT
Definition: pedump.c:61
BOOL m_iconFlag
Definition: CISFBand.h:33
unsigned int UINT
Definition: ndis.h:50
#define MM_SUBMENUSHAVEIDS
Definition: shlobj.h:2320
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
#define IDM_LARGE_ICONS
Definition: resource.h:68
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define IDM_SHOW_TEXT
Definition: resource.h:70

◆ QueryStatus()

STDMETHODIMP CISFBand::QueryStatus ( IN const GUID pguidCmdGroup,
IN ULONG  cCmds,
IN OUT OLECMD  prgCmds[],
IN OUT OLECMDTEXT pCmdText 
)
virtual

Definition at line 424 of file CISFBand.cpp.

425  {
427 
428  return E_NOTIMPL;
429  }
#define E_NOTIMPL
Definition: ddrawi.h:99
#define UNIMPLEMENTED
Definition: debug.h:114

◆ ResizeBorderDW()

STDMETHODIMP CISFBand::ResizeBorderDW ( LPCRECT  prcBorder,
IUnknown punkToolbarSite,
BOOL  fReserved 
)
virtual

Implements IDockingWindow.

Definition at line 202 of file CISFBand.cpp.

203  {
204  /* No need to implement this method */
205 
206  return E_NOTIMPL;
207  }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Save()

STDMETHODIMP CISFBand::Save ( IN IStream pStm,
IN BOOL  fClearDirty 
)
virtual

Definition at line 307 of file CISFBand.cpp.

308  {
309  /* Nothing to do */
310 
311  return S_OK;
312  }
#define S_OK
Definition: intsafe.h:59

◆ SetBandInfoSFB()

STDMETHODIMP CISFBand::SetBandInfoSFB ( PBANDINFOSFB  pbi)
virtual

Definition at line 518 of file CISFBand.cpp.

519  {
520  if ((pbi->dwMask & ISFB_MASK_STATE) &&
521  (pbi->dwState & ISFB_STATE_QLINKSMODE) &&
522  (pbi->dwStateMask & ISFB_STATE_QLINKSMODE))
523  {
524  m_QLaunch = true;
525  m_textFlag = false;
526  if (m_hWnd)
528  }
529 
530  return E_NOTIMPL;
531  }
#define ISFB_STATE_QLINKSMODE
Definition: shlobj.h:2556
_Inout_ PERBANDINFO * pbi
Definition: winddi.h:3917
#define ISFB_MASK_STATE
Definition: shlobj.h:2553
BOOL m_textFlag
Definition: CISFBand.h:32
BOOL m_QLaunch
Definition: CISFBand.h:34
#define E_NOTIMPL
Definition: ddrawi.h:99
#define SendMessage
Definition: winuser.h:5744
#define TBSTYLE_EX_MIXEDBUTTONS
Definition: commctrl.h:1008
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1186

◆ SetSite()

STDMETHODIMP CISFBand::SetSite ( IN IUnknown pUnkSite)
virtual

Definition at line 115 of file CISFBand.cpp.

116  {
117  HRESULT hr;
119 
120  TRACE("CISFBand::SetSite(0x%p)\n", pUnkSite);
121 
122  hr = IUnknown_GetWindow(pUnkSite, &hwndParent);
123  if (FAILED(hr))
124  {
125  TRACE("Querying site window failed: 0x%x\n", hr);
126  return hr;
127  }
128  m_Site = pUnkSite;
129 
131  if (FAILED_UNEXPECTEDLY(hr))
132  return hr;
133 
134  return S_OK;
135  }
CComPtr< IUnknown > m_Site
Definition: CISFBand.h:25
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1283
HRESULT CreateSimpleToolbar(HWND hWndParent)
Definition: CISFBand.cpp:54
static HWND hwndParent
Definition: cryptui.c:300
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define S_OK
Definition: intsafe.h:59

◆ ShowDW()

STDMETHODIMP CISFBand::ShowDW ( IN BOOL  bShow)
virtual

Definition at line 171 of file CISFBand.cpp.

172  {
173  if (m_hWnd)
174  {
175  ShowWindow(bShow ? SW_SHOW : SW_HIDE);
176  return S_OK;
177  }
178 
179  return E_FAIL;
180  }
#define SW_HIDE
Definition: winuser.h:762
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define E_FAIL
Definition: ddrawi.h:102
#define SW_SHOW
Definition: winuser.h:769
#define S_OK
Definition: intsafe.h:59

Member Data Documentation

◆ m_BandID

DWORD CISFBand::m_BandID
private

Definition at line 24 of file CISFBand.h.

Referenced by GetBandInfo().

◆ m_iconFlag

BOOL CISFBand::m_iconFlag
private

Definition at line 33 of file CISFBand.h.

Referenced by InvokeCommand(), and QueryContextMenu().

◆ m_pidl

PIDLIST_ABSOLUTE CISFBand::m_pidl
private

◆ m_pISF

CComPtr<IShellFolder> CISFBand::m_pISF
private

Definition at line 28 of file CISFBand.h.

Referenced by CreateSimpleToolbar(), InitializeSFB(), and OnWinEvent().

◆ m_QLaunch

BOOL CISFBand::m_QLaunch
private

Definition at line 34 of file CISFBand.h.

Referenced by GetBandInfo(), and SetBandInfoSFB().

◆ m_Site

CComPtr<IUnknown> CISFBand::m_Site
private

Definition at line 25 of file CISFBand.h.

Referenced by GetSite(), InvokeCommand(), and SetSite().

◆ m_textFlag

BOOL CISFBand::m_textFlag
private

Definition at line 32 of file CISFBand.h.

Referenced by CreateSimpleToolbar(), InvokeCommand(), QueryContextMenu(), and SetBandInfoSFB().


The documentation for this class was generated from the following files: