ReactOS  0.4.13-dev-656-g74bcf30
CBaseBar Class Reference
Inheritance diagram for CBaseBar:
Collaboration diagram for CBaseBar:

Public Member Functions

 CBaseBar ()
 
 ~CBaseBar ()
 
HRESULT Initialize (BOOL)
 
HRESULT ReserveBorderSpace ()
 
virtual HRESULT STDMETHODCALLTYPE GetWindow (HWND *lphwnd)
 
virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp (BOOL fEnterMode)
 
virtual HRESULT STDMETHODCALLTYPE OnFocusChangeIS (IUnknown *punkObj, BOOL fSetFocus)
 
virtual HRESULT STDMETHODCALLTYPE QueryStatus (const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
 
virtual HRESULT STDMETHODCALLTYPE Exec (const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
 
virtual HRESULT STDMETHODCALLTYPE QueryService (REFGUID guidService, REFIID riid, void **ppvObject)
 
virtual HRESULT STDMETHODCALLTYPE UIActivateIO (BOOL fActivate, LPMSG lpMsg)
 
virtual HRESULT STDMETHODCALLTYPE HasFocusIO ()
 
virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorIO (LPMSG lpMsg)
 
virtual HRESULT STDMETHODCALLTYPE SetClient (IUnknown *punkClient)
 
virtual HRESULT STDMETHODCALLTYPE GetClient (IUnknown **ppunkClient)
 
virtual HRESULT STDMETHODCALLTYPE OnPosRectChangeDB (LPRECT prc)
 
virtual HRESULT STDMETHODCALLTYPE ShowDW (BOOL fShow)
 
virtual HRESULT STDMETHODCALLTYPE CloseDW (DWORD dwReserved)
 
virtual HRESULT STDMETHODCALLTYPE ResizeBorderDW (LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved)
 
virtual HRESULT STDMETHODCALLTYPE SetSite (IUnknown *pUnkSite)
 
virtual HRESULT STDMETHODCALLTYPE GetSite (REFIID riid, void **ppvSite)
 
virtual HRESULT STDMETHODCALLTYPE GetClassID (CLSID *pClassID)
 
virtual HRESULT STDMETHODCALLTYPE IsDirty ()
 
virtual HRESULT STDMETHODCALLTYPE Load (IStream *pStm)
 
virtual HRESULT STDMETHODCALLTYPE Save (IStream *pStm, BOOL fClearDirty)
 
virtual HRESULT STDMETHODCALLTYPE GetSizeMax (ULARGE_INTEGER *pcbSize)
 
virtual HRESULT STDMETHODCALLTYPE InitNew ()
 
virtual HRESULT STDMETHODCALLTYPE Load (IPropertyBag *pPropBag, IErrorLog *pErrorLog)
 
virtual HRESULT STDMETHODCALLTYPE Save (IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
 
LRESULT OnSize (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSetCursor (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNotify (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnLButtonDown (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnLButtonUp (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnMouseMove (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCancelMode (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCaptureChanged (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
- 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 IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
- Public Member Functions inherited from IServiceProvider
HRESULT RemoteQueryService ([in] REFGUID guidService, [in] REFIID riid, [out, iid_is(riid)] IUnknown **ppvObject)
 
- Public Member Functions inherited from IDeskBar
HRESULT OnPosRectChangeDB ([in] RECT *prc)
 
- Public Member Functions inherited from IPersistStreamInit
HRESULT Load ([in] LPSTREAM pStm)
 
HRESULT Save ([in] LPSTREAM pStm, [in] BOOL fClearDirty)
 
- Public Member Functions inherited from IObjectWithSite
HRESULT GetSite ([in] REFIID riid, [out, iid_is(riid)] PVOID *ppvSite)
 

Private Attributes

CComPtr< IUnknownfSite
 
CComPtr< IUnknownfClient
 
HWND fClientWindow
 
bool fVertical
 
bool fVisible
 
int fNeededSize
 
bool fTracking
 
POINT fLastLocation
 

Additional Inherited Members

- 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 IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IServiceProvider
typedef IServiceProviderLPSERVICEPROVIDER
 
- 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 IPersistStreamInit
typedef IPersistStreamInitLPPERSISTSTREAMINIT
 
- Public Types inherited from IPersistPropertyBag
typedef IPersistPropertyBagLPPERSISTPROPERTYBAG
 
- Public Types inherited from IObjectWithSite
typedef IObjectWithSiteLPOBJECTWITHSITE
 
- 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
 

Detailed Description

Definition at line 39 of file CBaseBar.cpp.

Constructor & Destructor Documentation

◆ CBaseBar()

CBaseBar::CBaseBar ( )

Definition at line 163 of file CBaseBar.cpp.

164 {
166  fVertical = true;
167  fVisible = false;
168  fNeededSize = 200;
169  fTracking = false;
170 }
bool fVisible
Definition: CBaseBar.cpp:58
bool fVertical
Definition: CBaseBar.cpp:57
int fNeededSize
Definition: CBaseBar.cpp:59
smooth NULL
Definition: ftsmooth.c:416
bool fTracking
Definition: CBaseBar.cpp:62
HWND fClientWindow
Definition: CBaseBar.cpp:56

◆ ~CBaseBar()

CBaseBar::~CBaseBar ( )

Definition at line 172 of file CBaseBar.cpp.

173 {
174 }

Member Function Documentation

◆ CloseDW()

HRESULT STDMETHODCALLTYPE CBaseBar::CloseDW ( DWORD  dwReserved)
virtual

Implements IDockingWindow.

Definition at line 377 of file CBaseBar.cpp.

378 {
379  ShowDW(0);
380  // Detach from our client
381  SetClient(NULL);
382  // Destroy our site
383  SetSite(NULL);
384  return S_OK;
385 }
virtual HRESULT STDMETHODCALLTYPE SetClient(IUnknown *punkClient)
Definition: CBaseBar.cpp:316
virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite)
Definition: CBaseBar.cpp:393
smooth NULL
Definition: ftsmooth.c:416
virtual HRESULT STDMETHODCALLTYPE ShowDW(BOOL fShow)
Definition: CBaseBar.cpp:369
#define S_OK
Definition: intsafe.h:59

◆ ContextSensitiveHelp()

HRESULT STDMETHODCALLTYPE CBaseBar::ContextSensitiveHelp ( BOOL  fEnterMode)
virtual

Implements IOleWindow.

Definition at line 236 of file CBaseBar.cpp.

237 {
238  return E_NOTIMPL;
239 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Exec()

HRESULT STDMETHODCALLTYPE CBaseBar::Exec ( const GUID pguidCmdGroup,
DWORD  nCmdID,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
virtual

Implements IOleCommandTarget.

Definition at line 252 of file CBaseBar.cpp.

254 {
255  if (IsEqualIID(*pguidCmdGroup, CGID_Explorer))
256  {
257  // pass through to the explorer ?
258  }
259  else if (IsEqualIID(*pguidCmdGroup, IID_IDeskBarClient))
260  {
261  switch (nCmdID)
262  {
263  case 0:
264  {
265  // hide current band
266  ShowDW(0);
267 
268  // Inform our site that we closed
269  VARIANT var;
270  V_VT(&var) = VT_UNKNOWN;
271  V_UNKNOWN(&var) = static_cast<IDeskBar *>(this);
272  IUnknown_Exec(fSite, CGID_Explorer, 0x22, 0, &var, NULL);
273  break;
274  }
275  case 2:
276  // switch bands
277  break;
278  case 3:
279  break;
280  }
281  }
282  return E_NOTIMPL;
283 }
smooth NULL
Definition: ftsmooth.c:416
virtual HRESULT STDMETHODCALLTYPE ShowDW(BOOL fShow)
Definition: CBaseBar.cpp:369
#define V_VT(A)
Definition: oleauto.h:211
CComPtr< IUnknown > fSite
Definition: CBaseBar.cpp:54
#define V_UNKNOWN(A)
Definition: oleauto.h:281
#define E_NOTIMPL
Definition: ddrawi.h:99
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90
HRESULT WINAPI IUnknown_Exec(IUnknown *lpUnknown, REFGUID pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: ordinal.c:1034

◆ GetClassID()

HRESULT STDMETHODCALLTYPE CBaseBar::GetClassID ( CLSID pClassID)
virtual

Implements IPersist.

Definition at line 409 of file CBaseBar.cpp.

410 {
411  if (pClassID == NULL)
412  return E_POINTER;
413  // TODO: what class to return here?
414  return E_NOTIMPL;
415 }
smooth NULL
Definition: ftsmooth.c:416
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_POINTER
Definition: winerror.h:2365

◆ GetClient()

HRESULT STDMETHODCALLTYPE CBaseBar::GetClient ( IUnknown **  ppunkClient)
virtual

Implements IDeskBar.

Definition at line 347 of file CBaseBar.cpp.

348 {
349  if (ppunkClient == NULL)
350  return E_POINTER;
351  *ppunkClient = fClient;
352  if (fClient.p != NULL)
353  fClient.p->AddRef();
354  return S_OK;
355 }
smooth NULL
Definition: ftsmooth.c:416
ULONG AddRef()
CComPtr< IUnknown > fClient
Definition: CBaseBar.cpp:55
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ GetSite()

HRESULT STDMETHODCALLTYPE CBaseBar::GetSite ( REFIID  riid,
void **  ppvSite 
)
virtual

Definition at line 399 of file CBaseBar.cpp.

400 {
401  if (ppvSite == NULL)
402  return E_POINTER;
403  *ppvSite = fSite;
404  if (fSite.p != NULL)
405  fSite.p->AddRef();
406  return S_OK;
407 }
smooth NULL
Definition: ftsmooth.c:416
ULONG AddRef()
CComPtr< IUnknown > fSite
Definition: CBaseBar.cpp:54
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ GetSizeMax()

HRESULT STDMETHODCALLTYPE CBaseBar::GetSizeMax ( ULARGE_INTEGER pcbSize)
virtual

Implements IPersistStream.

Definition at line 432 of file CBaseBar.cpp.

433 {
434  if (pcbSize == NULL)
435  return E_POINTER;
436  return E_NOTIMPL;
437 }
smooth NULL
Definition: ftsmooth.c:416
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_POINTER
Definition: winerror.h:2365

◆ GetWindow()

HRESULT STDMETHODCALLTYPE CBaseBar::GetWindow ( HWND lphwnd)
virtual

Implements IOleWindow.

Definition at line 228 of file CBaseBar.cpp.

229 {
230  if (lphwnd == NULL)
231  return E_POINTER;
232  *lphwnd = m_hWnd;
233  return S_OK;
234 }
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ HasFocusIO()

HRESULT STDMETHODCALLTYPE CBaseBar::HasFocusIO ( )
virtual

Definition at line 306 of file CBaseBar.cpp.

307 {
309 }
HRESULT WINAPI IUnknown_HasFocusIO(IUnknown *lpUnknown)
Definition: ordinal.c:4136
CComPtr< IUnknown > fClient
Definition: CBaseBar.cpp:55

◆ Initialize()

HRESULT CBaseBar::Initialize ( BOOL  vert)

Definition at line 176 of file CBaseBar.cpp.

177 {
178  fVertical = (vert == TRUE);
179  return S_OK;
180 }
#define TRUE
Definition: types.h:120
bool fVertical
Definition: CBaseBar.cpp:57
#define S_OK
Definition: intsafe.h:59

◆ InitNew()

HRESULT STDMETHODCALLTYPE CBaseBar::InitNew ( void  )
virtual

Implements IPersistStreamInit.

Definition at line 439 of file CBaseBar.cpp.

440 {
441  return E_NOTIMPL;
442 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ IsDirty()

HRESULT STDMETHODCALLTYPE CBaseBar::IsDirty ( void  )
virtual

Implements IPersistStream.

Definition at line 417 of file CBaseBar.cpp.

418 {
419  return E_NOTIMPL;
420 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Load() [1/2]

HRESULT STDMETHODCALLTYPE CBaseBar::Load ( IStream pStm)
virtual

Implements IPersistStream.

Definition at line 422 of file CBaseBar.cpp.

423 {
424  return E_NOTIMPL;
425 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Load() [2/2]

HRESULT STDMETHODCALLTYPE CBaseBar::Load ( IPropertyBag pPropBag,
IErrorLog pErrorLog 
)
virtual

Implements IPersistPropertyBag.

Definition at line 444 of file CBaseBar.cpp.

445 {
446  return E_NOTIMPL;
447 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ OnCancelMode()

LRESULT CBaseBar::OnCancelMode ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 552 of file CBaseBar.cpp.

553 {
554  fTracking = false;
555  return 0;
556 }
bool fTracking
Definition: CBaseBar.cpp:62

◆ OnCaptureChanged()

LRESULT CBaseBar::OnCaptureChanged ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 558 of file CBaseBar.cpp.

559 {
560  fTracking = false;
561  return 0;
562 }
bool fTracking
Definition: CBaseBar.cpp:62

◆ OnFocusChangeIS()

HRESULT STDMETHODCALLTYPE CBaseBar::OnFocusChangeIS ( IUnknown punkObj,
BOOL  fSetFocus 
)
virtual

Definition at line 241 of file CBaseBar.cpp.

242 {
243  return IUnknown_OnFocusChangeIS(fSite, punkObj, fSetFocus);
244 }
HRESULT WINAPI IUnknown_OnFocusChangeIS(LPUNKNOWN lpUnknown, LPUNKNOWN pFocusObject, BOOL bFocus)
Definition: ordinal.c:4594
CComPtr< IUnknown > fSite
Definition: CBaseBar.cpp:54

◆ OnLButtonDown()

LRESULT CBaseBar::OnLButtonDown ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 514 of file CBaseBar.cpp.

515 {
516  SetCapture();
517  fTracking = true;
520  return 0;
521 }
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:93
bool fTracking
Definition: CBaseBar.cpp:62
HWND WINAPI SetCapture(_In_ HWND hWnd)
POINT fLastLocation
Definition: CBaseBar.cpp:63
#define HIWORD(l)
Definition: typedefs.h:246
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

◆ OnLButtonUp()

LRESULT CBaseBar::OnLButtonUp ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 523 of file CBaseBar.cpp.

524 {
525  ReleaseCapture();
526  fTracking = false;
527  return 0;
528 }
bool fTracking
Definition: CBaseBar.cpp:62
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2888

◆ OnMouseMove()

LRESULT CBaseBar::OnMouseMove ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 530 of file CBaseBar.cpp.

531 {
532  POINT newLocation;
533  int delta;
534 
535  if (fTracking)
536  {
537  newLocation.x = (short)LOWORD(lParam);
538  newLocation.y = (short)HIWORD(lParam);
539  if (fVertical)
540  delta = newLocation.x - fLastLocation.x;
541  else
542  delta = fLastLocation.y - newLocation.y;
543  if (fNeededSize + delta < 0)
544  return 0;
545  fNeededSize += delta;
546  fLastLocation = newLocation;
548  }
549  return 0;
550 }
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
bool fVertical
Definition: CBaseBar.cpp:57
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:93
int fNeededSize
Definition: CBaseBar.cpp:59
bool fTracking
Definition: CBaseBar.cpp:62
POINT fLastLocation
Definition: CBaseBar.cpp:63
HRESULT ReserveBorderSpace()
Definition: CBaseBar.cpp:182
#define HIWORD(l)
Definition: typedefs.h:246
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

◆ OnNotify()

LRESULT CBaseBar::OnNotify ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 498 of file CBaseBar.cpp.

499 {
500  CComPtr<IWinEventHandler> winEventHandler;
501  LRESULT result;
502  HRESULT hResult;
503 
504  result = 0;
505  if (fClient.p != NULL)
506  {
507  hResult = fClient->QueryInterface(IID_PPV_ARG(IWinEventHandler, &winEventHandler));
508  if (SUCCEEDED(hResult) && winEventHandler.p != NULL)
509  hResult = winEventHandler->OnWinEvent(NULL, uMsg, wParam, lParam, &result);
510  }
511  return result;
512 }
#define IID_PPV_ARG(Itype, ppType)
WPARAM wParam
Definition: combotst.c:138
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
CComPtr< IUnknown > fClient
Definition: CBaseBar.cpp:55
LONG_PTR LRESULT
Definition: windef.h:209
GLuint64EXT * result
Definition: glext.h:11304
LPARAM lParam
Definition: combotst.c:139
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ OnPosRectChangeDB()

HRESULT STDMETHODCALLTYPE CBaseBar::OnPosRectChangeDB ( LPRECT  prc)
virtual

Definition at line 357 of file CBaseBar.cpp.

358 {
359  if (prc == NULL)
360  return E_POINTER;
361  if (fVertical)
362  fNeededSize = prc->right - prc->left;
363  else
364  fNeededSize = prc->bottom - prc->top;
366  return S_OK;
367 }
bool fVertical
Definition: CBaseBar.cpp:57
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
int fNeededSize
Definition: CBaseBar.cpp:59
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
HRESULT ReserveBorderSpace()
Definition: CBaseBar.cpp:182
LONG bottom
Definition: windef.h:294
#define E_POINTER
Definition: winerror.h:2365
_Out_ LPRECT prc
Definition: ntgdi.h:1658

◆ OnSetCursor()

LRESULT CBaseBar::OnSetCursor ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 484 of file CBaseBar.cpp.

485 {
486  if ((short)lParam != HTCLIENT || (HWND)wParam != m_hWnd)
487  {
488  bHandled = FALSE;
489  return 0;
490  }
491  if (fVertical)
493  else
495  return 1;
496 }
#define IDC_SIZEWE
Definition: winuser.h:689
bool fVertical
Definition: CBaseBar.cpp:57
WPARAM wParam
Definition: combotst.c:138
#define IDC_SIZENS
Definition: winuser.h:690
smooth NULL
Definition: ftsmooth.c:416
#define LoadCursor
Definition: winuser.h:5710
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define HTCLIENT
Definition: winuser.h:2450
LPARAM lParam
Definition: combotst.c:139

◆ OnSize()

LRESULT CBaseBar::OnSize ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 454 of file CBaseBar.cpp.

455 {
456  DWORD dwWidth;
457  DWORD dwHeight;
458  CComPtr<IOleWindow> pClient;
459  HWND clientHwnd;
460  HRESULT hr;
461 
462  if (fVisible)
463  {
464  dwWidth = LOWORD(lParam);
466 
467  // substract resizing grips to child's window size
468  if (fVertical)
470  else
472  hr = fClient->QueryInterface(IID_PPV_ARG(IOleWindow, &pClient));
473  if (FAILED_UNEXPECTEDLY(hr))
474  return 0;
475  hr = pClient->GetWindow(&clientHwnd);
476  if (FAILED_UNEXPECTEDLY(hr))
477  return 0;
479  bHandled = TRUE;
480  }
481  return 0;
482 }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
bool fVisible
Definition: CBaseBar.cpp:58
bool fVertical
Definition: CBaseBar.cpp:57
#define SM_CXFRAME
Definition: winuser.h:984
#define IID_PPV_ARG(Itype, ppType)
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR dwHeight[]
Definition: provider.c:60
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
CComPtr< IUnknown > fClient
Definition: CBaseBar.cpp:55
#define HIWORD(l)
Definition: typedefs.h:246
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
static const WCHAR dwWidth[]
Definition: provider.c:59

◆ QueryService()

HRESULT STDMETHODCALLTYPE CBaseBar::QueryService ( REFGUID  guidService,
REFIID  riid,
void **  ppvObject 
)
virtual

Implements IServiceProvider.

Definition at line 285 of file CBaseBar.cpp.

286 {
287  CComPtr<IServiceProvider> serviceProvider;
288  HRESULT hResult;
289 
290  if (fSite == NULL)
291  return E_FAIL;
292  hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, &serviceProvider));
293  if (FAILED_UNEXPECTEDLY(hResult))
294  return hResult;
295  // called for SID_STopLevelBrowser, IID_IBrowserService to find top level browser
296  // called for SID_IWebBrowserApp, IID_IConnectionPointContainer
297  // connection point called for DIID_DWebBrowserEvents2 to establish connection
298  return serviceProvider->QueryService(guidService, riid, ppvObject);
299 }
REFIID riid
Definition: precomp.h:44
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
REFIID LPVOID * ppvObject
Definition: precomp.h:44
CComPtr< IUnknown > fSite
Definition: CBaseBar.cpp:54

◆ QueryStatus()

HRESULT STDMETHODCALLTYPE CBaseBar::QueryStatus ( const GUID pguidCmdGroup,
ULONG  cCmds,
OLECMD  prgCmds[],
OLECMDTEXT pCmdText 
)
virtual

Implements IOleCommandTarget.

Definition at line 246 of file CBaseBar.cpp.

248 {
249  return E_NOTIMPL;
250 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ReserveBorderSpace()

HRESULT CBaseBar::ReserveBorderSpace ( )

Definition at line 182 of file CBaseBar.cpp.

183 {
184  CComPtr<IDockingWindowSite> dockingWindowSite;
185  RECT availableBorderSpace;
186  RECT neededBorderSpace;
187  HRESULT hResult;
188 
189  hResult = fSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite, &dockingWindowSite));
190  if (FAILED_UNEXPECTEDLY(hResult))
191  return hResult;
192  hResult = dockingWindowSite->GetBorderDW(static_cast<IDeskBar *>(this), &availableBorderSpace);
193  if (FAILED_UNEXPECTEDLY(hResult))
194  return hResult;
195  memset(&neededBorderSpace, 0, sizeof(neededBorderSpace));
196  if (fVisible)
197  {
198  if (fVertical)
199  neededBorderSpace.left = fNeededSize + GetSystemMetrics(SM_CXFRAME);
200  else
201  neededBorderSpace.bottom = fNeededSize + GetSystemMetrics(SM_CXFRAME);
202  }
203  hResult = dockingWindowSite->SetBorderSpaceDW(static_cast<IDeskBar *>(this), &neededBorderSpace);
204  if (FAILED_UNEXPECTEDLY(hResult))
205  return hResult;
206  return S_OK;
207 }
bool fVisible
Definition: CBaseBar.cpp:58
bool fVertical
Definition: CBaseBar.cpp:57
LONG left
Definition: windef.h:291
#define SM_CXFRAME
Definition: winuser.h:984
#define IID_PPV_ARG(Itype, ppType)
int fNeededSize
Definition: CBaseBar.cpp:59
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
int WINAPI GetSystemMetrics(_In_ int)
CComPtr< IUnknown > fSite
Definition: CBaseBar.cpp:54
#define S_OK
Definition: intsafe.h:59
LONG bottom
Definition: windef.h:294
#define memset(x, y, z)
Definition: compat.h:39

Referenced by OnMouseMove(), OnPosRectChangeDB(), ResizeBorderDW(), SetClient(), and ShowDW().

◆ ResizeBorderDW()

HRESULT STDMETHODCALLTYPE CBaseBar::ResizeBorderDW ( LPCRECT  prcBorder,
IUnknown punkToolbarSite,
BOOL  fReserved 
)
virtual

Implements IDockingWindow.

Definition at line 387 of file CBaseBar.cpp.

388 {
390  return S_OK;
391 }
#define S_OK
Definition: intsafe.h:59
HRESULT ReserveBorderSpace()
Definition: CBaseBar.cpp:182

◆ Save() [1/2]

HRESULT STDMETHODCALLTYPE CBaseBar::Save ( IStream pStm,
BOOL  fClearDirty 
)
virtual

Implements IPersistStream.

Definition at line 427 of file CBaseBar.cpp.

428 {
429  return E_NOTIMPL;
430 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Save() [2/2]

HRESULT STDMETHODCALLTYPE CBaseBar::Save ( IPropertyBag pPropBag,
BOOL  fClearDirty,
BOOL  fSaveAllProperties 
)
virtual

Implements IPersistPropertyBag.

Definition at line 449 of file CBaseBar.cpp.

450 {
451  return E_NOTIMPL;
452 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ SetClient()

HRESULT STDMETHODCALLTYPE CBaseBar::SetClient ( IUnknown punkClient)
virtual

Implements IDeskBar.

Definition at line 316 of file CBaseBar.cpp.

317 {
318  CComPtr<IOleWindow> oleWindow;
319  HWND ownerWindow;
320  HRESULT hResult;
321 
322  /* Clean up old client */
323  fClient = NULL;
324 
325  if (punkClient)
326  {
327  hResult = punkClient->QueryInterface(IID_PPV_ARG(IUnknown, &fClient));
328  if (FAILED_UNEXPECTEDLY(hResult))
329  return hResult;
330  hResult = fSite->QueryInterface(IID_PPV_ARG(IOleWindow, &oleWindow));
331  if (FAILED_UNEXPECTEDLY(hResult))
332  return hResult;
333  hResult = oleWindow->GetWindow(&ownerWindow);
334  if (FAILED_UNEXPECTEDLY(hResult))
335  return hResult;
336  Create(ownerWindow, 0, NULL,
339  }
340  else
341  {
342  DestroyWindow();
343  }
344  return S_OK;
345 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
_In_ BOOLEAN Create
Definition: pstypes.h:511
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define IID_PPV_ARG(Itype, ppType)
BOOL WINAPI DestroyWindow(_In_ HWND)
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
smooth NULL
Definition: ftsmooth.c:416
#define WS_CHILDWINDOW
Definition: pedump.c:639
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
CComPtr< IUnknown > fClient
Definition: CBaseBar.cpp:55
CComPtr< IUnknown > fSite
Definition: CBaseBar.cpp:54
#define S_OK
Definition: intsafe.h:59
HRESULT ReserveBorderSpace()
Definition: CBaseBar.cpp:182
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by CloseDW().

◆ SetSite()

HRESULT STDMETHODCALLTYPE CBaseBar::SetSite ( IUnknown pUnkSite)
virtual

Implements IObjectWithSite.

Definition at line 393 of file CBaseBar.cpp.

394 {
395  fSite = pUnkSite;
396  return S_OK;
397 }
CComPtr< IUnknown > fSite
Definition: CBaseBar.cpp:54
#define S_OK
Definition: intsafe.h:59

Referenced by CloseDW().

◆ ShowDW()

HRESULT STDMETHODCALLTYPE CBaseBar::ShowDW ( BOOL  fShow)
virtual

Implements IDockingWindow.

Definition at line 369 of file CBaseBar.cpp.

370 {
371  fVisible = fShow ? true : false;
372  ShowWindow(fShow);
374  return S_OK;
375 }
bool fVisible
Definition: CBaseBar.cpp:58
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define S_OK
Definition: intsafe.h:59
HRESULT ReserveBorderSpace()
Definition: CBaseBar.cpp:182
#define true
Definition: stdbool.h:37

Referenced by CloseDW(), and Exec().

◆ TranslateAcceleratorIO()

HRESULT STDMETHODCALLTYPE CBaseBar::TranslateAcceleratorIO ( LPMSG  lpMsg)
virtual

Definition at line 311 of file CBaseBar.cpp.

312 {
314 }
CComPtr< IUnknown > fClient
Definition: CBaseBar.cpp:55
HRESULT WINAPI IUnknown_TranslateAcceleratorIO(IUnknown *lpUnknown, LPMSG lpMsg)
Definition: ordinal.c:4104

◆ UIActivateIO()

HRESULT STDMETHODCALLTYPE CBaseBar::UIActivateIO ( BOOL  fActivate,
LPMSG  lpMsg 
)
virtual

Definition at line 301 of file CBaseBar.cpp.

302 {
303  return IUnknown_UIActivateIO(fClient, fActivate, lpMsg);
304 }
HRESULT WINAPI IUnknown_UIActivateIO(IUnknown *unknown, BOOL activate, LPMSG msg)
Definition: ordinal.c:1580
CComPtr< IUnknown > fClient
Definition: CBaseBar.cpp:55

Member Data Documentation

◆ fClient

CComPtr<IUnknown> CBaseBar::fClient
private

◆ fClientWindow

HWND CBaseBar::fClientWindow
private

Definition at line 56 of file CBaseBar.cpp.

Referenced by CBaseBar().

◆ fLastLocation

POINT CBaseBar::fLastLocation
private

Definition at line 63 of file CBaseBar.cpp.

Referenced by OnLButtonDown(), and OnMouseMove().

◆ fNeededSize

int CBaseBar::fNeededSize
private

Definition at line 59 of file CBaseBar.cpp.

Referenced by CBaseBar(), OnMouseMove(), OnPosRectChangeDB(), and ReserveBorderSpace().

◆ fSite

CComPtr<IUnknown> CBaseBar::fSite
private

◆ fTracking

bool CBaseBar::fTracking
private

◆ fVertical

bool CBaseBar::fVertical
private

◆ fVisible

bool CBaseBar::fVisible
private

Definition at line 58 of file CBaseBar.cpp.

Referenced by CBaseBar(), OnSize(), ReserveBorderSpace(), and ShowDW().


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