ReactOS  0.4.14-dev-376-gaedba84
CTrayWindow Class Reference
Inheritance diagram for CTrayWindow:
Collaboration diagram for CTrayWindow:

Classes

struct  MINIMIZE_INFO
 

Public Member Functions

 CTrayWindow ()
 
virtual ~CTrayWindow ()
 
HRESULT ExecResourceCmd (int id)
 
LRESULT DoExitWindows ()
 
DWORD WINAPI RunFileDlgThread ()
 
void DisplayRunFileDlg ()
 
DWORD WINAPI TrayPropertiesThread ()
 
HWND STDMETHODCALLTYPE DisplayProperties ()
 
VOID OpenCommonStartMenuDirectory (IN HWND hWndOwner, IN LPCTSTR lpOperation)
 
VOID OpenTaskManager (IN HWND hWndOwner)
 
VOID ToggleDesktop ()
 
BOOL STDMETHODCALLTYPE ExecContextMenuCmd (IN UINT uiCmd)
 
LRESULT HandleHotKey (DWORD id)
 
LRESULT HandleCommand (UINT uCommand)
 
UINT TrackMenu (IN HMENU hMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN BOOL IsContextMenu)
 
HRESULT TrackCtxMenu (IN IContextMenu *contextMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN PVOID Context OPTIONAL)
 
void UpdateFonts ()
 
HMONITOR GetScreenRectFromRect (IN OUT RECT *pRect, IN DWORD dwFlags)
 
HMONITOR GetMonitorFromRect (IN const RECT *pRect)
 
HMONITOR GetScreenRect (IN HMONITOR hMonitor, IN OUT RECT *pRect)
 
VOID AdjustSizerRect (RECT *rc, DWORD pos)
 
VOID MakeTrayRectWithSize (IN DWORD Position, IN const SIZE *pTraySize, IN OUT RECT *pRect)
 
VOID GetTrayRectFromScreenRect (IN DWORD Position, IN const RECT *pScreen, IN const SIZE *pTraySize OPTIONAL, OUT RECT *pRect)
 
BOOL IsPosHorizontal ()
 
HMONITOR CalculateValidSize (IN DWORD Position, IN OUT RECT *pRect)
 
DWORD GetDraggingRectFromPt (IN POINT pt, OUT RECT *pRect, OUT HMONITOR *phMonitor)
 
DWORD GetDraggingRectFromRect (IN OUT RECT *pRect, OUT HMONITOR *phMonitor)
 
VOID ChangingWinPos (IN OUT LPWINDOWPOS pwp)
 
VOID ApplyClipping (IN BOOL Clip)
 
VOID ResizeWorkArea ()
 
VOID CheckTrayWndPosition ()
 
VOID RegLoadSettings ()
 
VOID AlignControls (IN PRECT prcClient OPTIONAL)
 
void FitToRebar (PRECT pRect)
 
void PopupStartMenu ()
 
void ProcessMouseTracking ()
 
void ProcessAutoHide ()
 
LRESULT EraseBackgroundWithTheme (HDC hdc)
 
int DrawSizerWithTheme (IN HRGN hRgn)
 
HRESULT STDMETHODCALLTYPE Open ()
 
HRESULT STDMETHODCALLTYPE Close ()
 
HWND STDMETHODCALLTYPE GetHWND ()
 
BOOL STDMETHODCALLTYPE IsSpecialHWND (IN HWND hWnd)
 
BOOL STDMETHODCALLTYPE IsHorizontal ()
 
BOOL STDMETHODCALLTYPE Lock (IN BOOL bLock)
 
HRESULT STDMETHODCALLTYPE QueryContextMenu (HMENU hPopup, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
 
HRESULT STDMETHODCALLTYPE InvokeCommand (LPCMINVOKECOMMANDINFO lpici)
 
HRESULT STDMETHODCALLTYPE GetCommandString (UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax)
 
LRESULT OnCreate (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnThemeChanged (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSettingChanged (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnEraseBackground (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnDisplayChange (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCopyData (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNcPaint (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCtlColorBtn (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNcHitTest (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnMoving (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSizing (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnWindowPosChanging (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSize (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnEnterSizeMove (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnExitSizeMove (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSysChar (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNcLButtonDown (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNcRButtonUp (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnContextMenu (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNotify (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNcLButtonDblClick (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnAppTrayDestroy (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnOpenStartMenu (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnDoExitWindows (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSysCommand (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnGetTaskSwitch (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnHotkey (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
VOID MinimizeAll (BOOL bShowDesktop=FALSE)
 
VOID ShowDesktop ()
 
VOID RestoreAll ()
 
LRESULT OnCommand (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnMouseMove (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnTimer (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNcCalcSize (INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnInitMenuPopup (INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnRebarAutoSize (INT code, LPNMHDR nmhdr, BOOL &bHandled)
 
LRESULT OnTaskbarSettingsChanged (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
 if (m_StartMenuBand !=NULL)
 
 NOTIFY_CODE_HANDLER (RBN_AUTOSIZE, OnRebarAutoSize) VOID TrayProcessMessages()
 
VOID TrayMessageLoop ()
 
virtual ULONG STDMETHODCALLTYPE GetState ()
 
virtual HRESULT STDMETHODCALLTYPE GetTrayWindow (OUT HWND *phWndTray)
 
virtual HRESULT STDMETHODCALLTYPE RegisterDesktopWindow (IN HWND hWndDesktop)
 
virtual HRESULT STDMETHODCALLTYPE Unknown (IN DWORD dwUnknown1, IN DWORD dwUnknown2)
 
virtual HRESULT RaiseStartButton ()
 
HRESULT WINAPI GetWindow (HWND *phwnd)
 
HRESULT WINAPI ContextSensitiveHelp (BOOL fEnterMode)
 
void _Init ()
 
- 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 ATL::CWindowImpl< CTrayWindow, CWindow, CControlWinTraits >
HWND Create (HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
- Public Member Functions inherited from ATL::CWindowImplBaseT< CWindow, CControlWinTraits >
 CWindowImplBaseT ()
 
virtual void OnFinalMessage (HWND)
 
BOOL SubclassWindow (HWND hWnd)
 
virtual WNDPROC GetWindowProc ()
 
LRESULT DefWindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
HWND Create (HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName, DWORD dwStyle, DWORD dwExStyle, _U_MENUorID MenuOrID, ATOM atom, LPVOID lpCreateParam)
 
- Public Member Functions inherited from ATL::CWindowImplRoot< CWindow >
 CWindowImplRoot ()
 
virtual ~CWindowImplRoot ()
 
- Public Member Functions inherited from ATL::CWindow
 CWindow (HWND hWnd=NULL)
 
 operator HWND () const
 
UINT ArrangeIconicWindows ()
 
void Attach (HWND hWndNew)
 
HDC BeginPaint (LPPAINTSTRUCT lpPaint)
 
BOOL BringWindowToTop ()
 
BOOL CenterWindow (HWND hWndCenter=NULL)
 
BOOL ChangeClipboardChain (HWND hWndNewNext)
 
BOOL CheckDlgButton (int nIDButton, UINT nCheck)
 
BOOL CheckRadioButton (int nIDFirstButton, int nIDLastButton, int nIDCheckButton)
 
HWND ChildWindowFromPoint (POINT point) const
 
HWND ChildWindowFromPointEx (POINT point, UINT uFlags) const
 
BOOL ClientToScreen (LPPOINT lpPoint) const
 
BOOL ClientToScreen (LPRECT lpRect) const
 
HWND Create (LPCTSTR lpstrWndClass, HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
BOOL CreateCaret (HBITMAP pBitmap)
 
BOOL CreateGrayCaret (int nWidth, int nHeight)
 
BOOL CreateSolidCaret (int nWidth, int nHeight)
 
HDWP DeferWindowPos (HDWP hWinPosInfo, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags)
 
BOOL DestroyWindow ()
 
HWND Detach ()
 
int DlgDirList (LPTSTR lpPathSpec, int nIDListBox, int nIDStaticPath, UINT nFileType)
 
int DlgDirListComboBox (LPTSTR lpPathSpec, int nIDComboBox, int nIDStaticPath, UINT nFileType)
 
BOOL DlgDirSelect (LPTSTR lpString, int nCount, int nIDListBox)
 
BOOL DlgDirSelectComboBox (LPTSTR lpString, int nCount, int nIDComboBox)
 
void DragAcceptFiles (BOOL bAccept=TRUE)
 
BOOL DrawMenuBar ()
 
BOOL EnableScrollBar (UINT uSBFlags, UINT uArrowFlags=ESB_ENABLE_BOTH)
 
BOOL EnableWindow (BOOL bEnable=TRUE)
 
void EndPaint (LPPAINTSTRUCT lpPaint)
 
BOOL FlashWindow (BOOL bInvert)
 
BOOL GetClientRect (LPRECT lpRect) const
 
HDC GetDC ()
 
HDC GetDCEx (HRGN hRgnClip, DWORD flags)
 
HWND GetDescendantWindow (int nID) const
 
HRESULT GetDlgControl (int nID, REFIID iid, void **ppCtrl)
 
int GetDlgCtrlID () const
 
HRESULT GetDlgHost (int nID, REFIID iid, void **ppHost)
 
HWND GetDlgItem (int nID)
 
UINT GetDlgItemInt (int nID, BOOL *lpTrans=NULL, BOOL bSigned=TRUE) const
 
UINT GetDlgItemText (int nID, LPTSTR lpStr, int nMaxCount) const
 
BOOL GetDlgItemText (int nID, BSTR &bstrText) const
 
DWORD GetExStyle () const
 
HFONT GetFont () const
 
DWORD GetHotKey () const
 
HICON GetIcon (BOOL bBigIcon=TRUE) const
 
HWND GetLastActivePopup () const
 
HMENU GetMenu () const
 
HWND GetNextDlgGroupItem (HWND hWndCtl, BOOL bPrevious=FALSE) const
 
HWND GetNextDlgTabItem (HWND hWndCtl, BOOL bPrevious=FALSE) const
 
CWindow GetParent () const
 
BOOL GetScrollInfo (int nBar, LPSCROLLINFO lpScrollInfo)
 
BOOL GetScrollPos (int nBar)
 
BOOL GetScrollRange (int nBar, LPINT lpMinPos, LPINT lpMaxPos) const
 
DWORD GetStyle () const
 
HMENU GetSystemMenu (BOOL bRevert)
 
HWND GetTopLevelParent () const
 
HWND GetTopLevelWindow () const
 
HWND GetTopWindow () const
 
BOOL GetUpdateRect (LPRECT lpRect, BOOL bErase=FALSE)
 
int GetUpdateRgn (HRGN hRgn, BOOL bErase=FALSE)
 
HWND GetWindow (UINT nCmd) const
 
DWORD GetWindowContextHelpId () const
 
HDC GetWindowDC ()
 
LONG GetWindowLong (int nIndex) const
 
LONG_PTR GetWindowLongPtr (int nIndex) const
 
BOOL GetWindowPlacement (WINDOWPLACEMENT *lpwndpl) const
 
DWORD GetWindowProcessID ()
 
BOOL GetWindowRect (LPRECT lpRect) const
 
int GetWindowRgn (HRGN hRgn)
 
int GetWindowText (LPTSTR lpszStringBuf, int nMaxCount) const
 
BOOL GetWindowText (BSTR &bstrText)
 
int GetWindowTextLength () const
 
DWORD GetWindowThreadID ()
 
WORD GetWindowWord (int nIndex) const
 
void GotoDlgCtrl (HWND hWndCtrl) const
 
BOOL HideCaret ()
 
BOOL HiliteMenuItem (HMENU hMenu, UINT uHiliteItem, UINT uHilite)
 
BOOL Invalidate (BOOL bErase=TRUE)
 
BOOL InvalidateRect (LPCRECT lpRect, BOOL bErase=TRUE)
 
void InvalidateRgn (HRGN hRgn, BOOL bErase=TRUE)
 
BOOL IsChild (const HWND hWnd) const
 
BOOL IsDialogMessage (LPMSG lpMsg)
 
UINT IsDlgButtonChecked (int nIDButton) const
 
BOOL IsIconic () const
 
BOOL IsParentDialog ()
 
BOOL IsWindow () const
 
BOOL IsWindowEnabled () const
 
BOOL IsWindowVisible () const
 
BOOL IsWindowUnicode ()
 
BOOL IsZoomed () const
 
BOOL KillTimer (UINT_PTR nIDEvent)
 
BOOL LockWindowUpdate (BOOL bLock=TRUE)
 
int MapWindowPoints (HWND hWndTo, LPPOINT lpPoint, UINT nCount) const
 
int MapWindowPoints (HWND hWndTo, LPRECT lpRect) const
 
int MessageBox (LPCTSTR lpszText, LPCTSTR lpszCaption=NULL, UINT nType=MB_OK)
 
BOOL ModifyStyle (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
 
BOOL ModifyStyleEx (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
 
BOOL MoveWindow (int x, int y, int nWidth, int nHeight, BOOL bRepaint=TRUE)
 
void NextDlgCtrl () const
 
BOOL OpenClipboard ()
 
BOOL PostMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
void PrevDlgCtrl () const
 
void Print (HDC hDC, DWORD dwFlags) const
 
void PrintClient (HDC hDC, DWORD dwFlags) const
 
BOOL RedrawWindow (LPCRECT lpRectUpdate=NULL, HRGN hRgnUpdate=NULL, UINT flags=RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE)
 
int ReleaseDC (HDC hDC)
 
BOOL ResizeClient (int nWidth, int nHeight, BOOL bRedraw=FALSE)
 
BOOL ScreenToClient (LPPOINT lpPoint) const
 
BOOL ScrollWindow (int xAmount, int yAmount, LPCRECT lpRect=NULL, LPCRECT lpClipRect=NULL)
 
int ScrollWindowEx (int dx, int dy, LPCRECT lpRectScroll, LPCRECT lpRectClip, HRGN hRgnUpdate, LPRECT lpRectUpdate, UINT flags)
 
LRESULT SendDlgItemMessage (int nID, UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
LRESULT SendMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
void SendMessageToDescendants (UINT message, WPARAM wParam=0, LPARAM lParam=0, BOOL bDeep=TRUE)
 
BOOL SendNotifyMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
HWND SetActiveWindow ()
 
HWND SetCapture ()
 
HWND SetClipboardViewer ()
 
int SetDlgCtrlID (int nID)
 
BOOL SetDlgItemInt (int nID, UINT nValue, BOOL bSigned=TRUE)
 
BOOL SetDlgItemText (int nID, LPCTSTR lpszString)
 
HWND SetFocus ()
 
void SetFont (HFONT hFont, BOOL bRedraw=TRUE)
 
int SetHotKey (WORD wVirtualKeyCode, WORD wModifiers)
 
HICON SetIcon (HICON hIcon, BOOL bBigIcon=TRUE)
 
BOOL SetMenu (HMENU hMenu)
 
HWND SetParent (HWND hWndNewParent)
 
void SetRedraw (BOOL bRedraw=TRUE)
 
int SetScrollInfo (int nBar, LPSCROLLINFO lpScrollInfo, BOOL bRedraw=TRUE)
 
int SetScrollPos (int nBar, int nPos, BOOL bRedraw=TRUE)
 
BOOL SetScrollRange (int nBar, int nMinPos, int nMaxPos, BOOL bRedraw=TRUE)
 
UINT_PTR SetTimer (UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL)
 
BOOL SetWindowContextHelpId (DWORD dwContextHelpId)
 
LONG SetWindowLong (int nIndex, LONG dwNewLong)
 
LONG_PTR SetWindowLongPtr (int nIndex, LONG_PTR dwNewLong)
 
BOOL SetWindowPlacement (const WINDOWPLACEMENT *lpwndpl)
 
BOOL SetWindowPos (HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
 
int SetWindowRgn (HRGN hRgn, BOOL bRedraw=FALSE)
 
BOOL SetWindowText (LPCTSTR lpszString)
 
WORD SetWindowWord (int nIndex, WORD wNewWord)
 
BOOL ShowCaret ()
 
BOOL ShowOwnedPopups (BOOL bShow=TRUE)
 
BOOL ShowScrollBar (UINT nBar, BOOL bShow=TRUE)
 
BOOL ShowWindow (int nCmdShow)
 
BOOL ShowWindowAsync (int nCmdShow)
 
BOOL UpdateWindow ()
 
BOOL ValidateRect (LPCRECT lpRect)
 
BOOL ValidateRgn (HRGN hRgn)
 
BOOL WinHelp (LPCTSTR lpszHelp, UINT nCmd=HELP_CONTEXT, DWORD dwData=0)
 
- Public Member Functions inherited from ATL::CMessageMap
virtual BOOL ProcessWindowMessage (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID)=0
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Static Public Member Functions

static DWORD WINAPI s_RunFileDlgThread (IN OUT PVOID pParam)
 
static DWORD WINAPI s_TrayPropertiesThread (IN OUT PVOID pParam)
 
static BOOL IsDialog (HWND hwnd)
 
static BOOL CALLBACK MinimizeWindowsProc (HWND hwnd, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CComCoClass< CTrayWindow >
static LPCTSTR WINAPI GetObjectDescription ()
 
- 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)
 
- Static Public Member Functions inherited from ATL::CWindowImpl< CTrayWindow, CWindow, CControlWinTraits >
static LPCTSTR GetWndCaption ()
 
- Static Public Member Functions inherited from ATL::CWindowImplBaseT< CWindow, CControlWinTraits >
static DWORD GetWndStyle (DWORD dwStyle)
 
static DWORD GetWndExStyle (DWORD dwExStyle)
 
static LRESULT CALLBACK StartWindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CWindow
static LPCTSTR GetWndClassName ()
 
static LRESULT SendMessage (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 

Public Attributes

CComPtr< ITrayBandSite > m_TrayBandSite
 
union {
   DWORD   Flags
 
   struct {
      DWORD   InSizeMove: 1
 
      DWORD   IsDragging: 1
 
      DWORD   NewPosSize: 1
 
   } 
 
}; 
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Public Attributes inherited from ATL::CWindowImplBaseT< CWindow, CControlWinTraits >
WNDPROC m_pfnSuperWindowProc
 
- Public Attributes inherited from ATL::CWindowImplRoot< CWindow >
CWndProcThunk m_thunk
 
const _ATL_MSGm_pCurrentMsg
 
DWORD m_dwState
 
- Public Attributes inherited from ATL::CWindow
HWND m_hWnd
 
- Public Attributes inherited from IContextMenu
CMIC_MASK_NOZONECHECKS typedef IContextMenuLPCONTEXTMENU
 

Private Attributes

CStartButton m_StartButton
 
CComPtr< IMenuBandm_StartMenuBand
 
CComPtr< IMenuPopupm_StartMenuPopup
 
CComPtr< IDeskBandm_TaskBand
 
CComPtr< IContextMenum_ContextMenu
 
HTHEME m_Theme
 
HFONT m_Font
 
HWND m_DesktopWnd
 
HWND m_Rebar
 
HWND m_TaskSwitch
 
HWND m_TrayNotify
 
CComPtr< IUnknownm_TrayNotifyInstance
 
DWORD m_Position
 
HMONITOR m_Monitor
 
HMONITOR m_PreviousMonitor
 
DWORD m_DraggingPosition
 
HMONITOR m_DraggingMonitor
 
RECT m_TrayRects [4]
 
SIZE m_TraySize
 
HWND m_TrayPropertiesOwner
 
HWND m_RunFileDlgOwner
 
UINT m_AutoHideState
 
SIZE m_AutoHideOffset
 
TRACKMOUSEEVENT m_MouseTrackingInfo
 
HDPA m_ShellServices
 

Additional Inherited Members

- Public Types inherited from ATL::CWindowImplRoot< CWindow >
enum  
 
- Public Types inherited from IOleWindow
typedef IOleWindowLPOLEWINDOW
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- 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 Attributes inherited from ATL::CWindow
static RECT rcDefault
 
- 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 260 of file traywnd.cpp.

Constructor & Destructor Documentation

◆ CTrayWindow()

CTrayWindow::CTrayWindow ( )
inline

Definition at line 321 of file traywnd.cpp.

321  :
322  m_StartButton(),
323  m_Theme(NULL),
324  m_Font(NULL),
326  m_Rebar(NULL),
329  m_Position(0),
330  m_Monitor(NULL),
338  Flags(0)
339  {
341  ZeroMemory(&m_TraySize, sizeof(m_TraySize));
344  }
HWND m_RunFileDlgOwner
Definition: traywnd.cpp:297
HFONT m_Font
Definition: traywnd.cpp:278
#define ZeroMemory
Definition: winbase.h:1642
DWORD Flags
Definition: traywnd.cpp:310
DWORD m_Position
Definition: traywnd.cpp:287
HMONITOR m_PreviousMonitor
Definition: traywnd.cpp:289
HWND m_DesktopWnd
Definition: traywnd.cpp:280
HWND m_Rebar
Definition: traywnd.cpp:281
HWND m_TrayNotify
Definition: traywnd.cpp:283
TRACKMOUSEEVENT m_MouseTrackingInfo
Definition: traywnd.cpp:301
smooth NULL
Definition: ftsmooth.c:416
HWND m_TrayPropertiesOwner
Definition: traywnd.cpp:296
RECT m_TrayRects[4]
Definition: traywnd.cpp:293
CStartButton m_StartButton
Definition: traywnd.cpp:269
UINT m_AutoHideState
Definition: traywnd.cpp:299
DWORD m_DraggingPosition
Definition: traywnd.cpp:290
HTHEME m_Theme
Definition: traywnd.cpp:276
HMONITOR m_DraggingMonitor
Definition: traywnd.cpp:291
HDPA m_ShellServices
Definition: traywnd.cpp:303
HMONITOR m_Monitor
Definition: traywnd.cpp:288
HWND m_TaskSwitch
Definition: traywnd.cpp:282
SIZE m_AutoHideOffset
Definition: traywnd.cpp:300
SIZE m_TraySize
Definition: traywnd.cpp:294

◆ ~CTrayWindow()

virtual CTrayWindow::~CTrayWindow ( )
inlinevirtual

Definition at line 346 of file traywnd.cpp.

347  {
348  if (m_ShellServices != NULL)
349  {
352  }
353 
354  if (m_Font != NULL)
355  {
357  m_Font = NULL;
358  }
359 
360  if (m_Theme)
361  {
363  m_Theme = NULL;
364  }
365 
366  PostQuitMessage(0);
367  }
HRESULT ShutdownShellServices(HDPA hdpa)
HFONT m_Font
Definition: traywnd.cpp:278
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
smooth NULL
Definition: ftsmooth.c:416
HTHEME m_Theme
Definition: traywnd.cpp:276
HDPA m_ShellServices
Definition: traywnd.cpp:303
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:950

Member Function Documentation

◆ _Init()

void CTrayWindow::_Init ( )
inline

Definition at line 3234 of file traywnd.cpp.

3235  {
3236  m_Position = (DWORD) -1;
3237  }
DWORD m_Position
Definition: traywnd.cpp:287
#define DWORD
Definition: nt_native.h:44

◆ AdjustSizerRect()

VOID CTrayWindow::AdjustSizerRect ( RECT rc,
DWORD  pos 
)
inline

Definition at line 1044 of file traywnd.cpp.

1045  {
1047  SIZE size;
1048 
1049  if (pos > ABE_BOTTOM)
1050  pos = ABE_BOTTOM;
1051 
1052  HRESULT hr = GetThemePartSize(m_Theme, NULL, iSizerPart[pos], 0, NULL, TS_TRUE, &size);
1053  if (FAILED_UNEXPECTEDLY(hr))
1054  return;
1055 
1056  switch (pos)
1057  {
1058  case ABE_TOP:
1059  rc->bottom -= size.cy;
1060  break;
1061  case ABE_BOTTOM:
1062  rc->top += size.cy;
1063  break;
1064  case ABE_LEFT:
1065  rc->right -= size.cx;
1066  break;
1067  case ABE_RIGHT:
1068  rc->left += size.cx;
1069  break;
1070  }
1071  }
HRESULT WINAPI GetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, THEMESIZE eSize, SIZE *psz)
Definition: draw.c:1777
#define ABE_TOP
Definition: shellapi.h:18
HRESULT hr
Definition: shlfolder.c:183
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
#define ABE_LEFT
Definition: shellapi.h:17
smooth NULL
Definition: ftsmooth.c:416
#define ABE_RIGHT
Definition: shellapi.h:19
GLsizeiptr size
Definition: glext.h:5919
HTHEME m_Theme
Definition: traywnd.cpp:276
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define ABE_BOTTOM
Definition: shellapi.h:20
LONG bottom
Definition: windef.h:294

Referenced by Lock(), and OnNcCalcSize().

◆ AlignControls()

VOID CTrayWindow::AlignControls ( IN PRECT prcClient  OPTIONAL)
inline

Definition at line 1581 of file traywnd.cpp.

1582  {
1583  RECT rcClient;
1584  SIZE TraySize, StartSize;
1585  POINT ptTrayNotify = { 0, 0 };
1586  BOOL Horizontal;
1587  HDWP dwp;
1588 
1590  if (prcClient != NULL)
1591  {
1592  rcClient = *prcClient;
1593  }
1594  else
1595  {
1596  if (!GetClientRect(&rcClient))
1597  {
1598  ERR("Could not get client rect lastErr=%d\n", GetLastError());
1599  return;
1600  }
1601  }
1602 
1603  Horizontal = IsPosHorizontal();
1604 
1605  /* We're about to resize/move the start button, the rebar control and
1606  the tray notification control */
1607  dwp = BeginDeferWindowPos(3);
1608  if (dwp == NULL)
1609  {
1610  ERR("BeginDeferWindowPos failed. lastErr=%d\n", GetLastError());
1611  return;
1612  }
1613 
1614  /* Limit the Start button width to the client width, if necessary */
1615  StartSize = m_StartButton.GetSize();
1616  if (StartSize.cx > rcClient.right)
1617  StartSize.cx = rcClient.right;
1618 
1619  if (!m_Theme)
1620  {
1621  HWND hwndTaskToolbar = ::GetWindow(m_TaskSwitch, GW_CHILD);
1622  if (hwndTaskToolbar)
1623  {
1624  DWORD size = SendMessageW(hwndTaskToolbar, TB_GETBUTTONSIZE, 0, 0);
1625  StartSize.cy = HIWORD(size);
1626  }
1627  }
1628 
1629  if (m_StartButton.m_hWnd != NULL)
1630  {
1631  /* Resize and reposition the button */
1632  dwp = m_StartButton.DeferWindowPos(dwp,
1633  NULL,
1634  0,
1635  0,
1636  StartSize.cx,
1637  StartSize.cy,
1639  if (dwp == NULL)
1640  {
1641  ERR("DeferWindowPos for start button failed. lastErr=%d\n", GetLastError());
1642  return;
1643  }
1644  }
1645 
1646  /* Determine the size that the tray notification window needs */
1647  if (Horizontal)
1648  {
1649  TraySize.cx = 0;
1650  TraySize.cy = rcClient.bottom;
1651  }
1652  else
1653  {
1654  TraySize.cx = rcClient.right;
1655  TraySize.cy = 0;
1656  }
1657 
1658  if (m_TrayNotify != NULL &&
1661  (WPARAM)Horizontal,
1662  (LPARAM)&TraySize))
1663  {
1664  /* Move the tray notification window to the desired location */
1665  if (Horizontal)
1666  ptTrayNotify.x = rcClient.right - TraySize.cx;
1667  else
1668  ptTrayNotify.y = rcClient.bottom - TraySize.cy;
1669 
1670  dwp = ::DeferWindowPos(dwp,
1671  m_TrayNotify,
1672  NULL,
1673  ptTrayNotify.x,
1674  ptTrayNotify.y,
1675  TraySize.cx,
1676  TraySize.cy,
1678  if (dwp == NULL)
1679  {
1680  ERR("DeferWindowPos for notification area failed. lastErr=%d\n", GetLastError());
1681  return;
1682  }
1683  }
1684 
1685  /* Resize/Move the rebar control */
1686  if (m_Rebar != NULL)
1687  {
1688  POINT ptRebar = { 0, 0 };
1689  SIZE szRebar;
1690 
1691  SetWindowStyle(m_Rebar, CCS_VERT, Horizontal ? 0 : CCS_VERT);
1692 
1693  if (Horizontal)
1694  {
1695  ptRebar.x = StartSize.cx + GetSystemMetrics(SM_CXSIZEFRAME);
1696  szRebar.cx = ptTrayNotify.x - ptRebar.x;
1697  szRebar.cy = rcClient.bottom;
1698  }
1699  else
1700  {
1701  ptRebar.y = StartSize.cy + GetSystemMetrics(SM_CYSIZEFRAME);
1702  szRebar.cx = rcClient.right;
1703  szRebar.cy = ptTrayNotify.y - ptRebar.y;
1704  }
1705 
1706  dwp = ::DeferWindowPos(dwp,
1707  m_Rebar,
1708  NULL,
1709  ptRebar.x,
1710  ptRebar.y,
1711  szRebar.cx,
1712  szRebar.cy,
1714  }
1715 
1716  if (dwp != NULL)
1717  EndDeferWindowPos(dwp);
1718 
1719  if (m_TaskSwitch != NULL)
1720  {
1721  /* Update the task switch window configuration */
1723  }
1724  }
SIZE GetSize()
Definition: traywnd.cpp:162
HDWP WINAPI BeginDeferWindowPos(_In_ int)
#define GW_CHILD
Definition: winuser.h:758
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define TNWM_GETMINIMUMSIZE
Definition: precomp.h:333
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
UINT_PTR WPARAM
Definition: windef.h:207
#define SWP_NOZORDER
Definition: winuser.h:1232
#define SetWindowStyle(hwnd, val)
Definition: utility.h:153
LONG right
Definition: windef.h:293
#define CCS_VERT
Definition: commctrl.h:2245
HWND m_Rebar
Definition: traywnd.cpp:281
HWND m_TrayNotify
Definition: traywnd.cpp:283
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
BOOL GetClientRect(LPRECT lpRect) const
Definition: atlwin.h:507
smooth NULL
Definition: ftsmooth.c:416
#define SM_CYSIZEFRAME
Definition: winuser.h:985
LONG cx
Definition: windef.h:319
LONG_PTR LPARAM
Definition: windef.h:208
BOOL IsPosHorizontal()
Definition: traywnd.cpp:1119
CStartButton m_StartButton
Definition: traywnd.cpp:269
#define SM_CXSIZEFRAME
Definition: winuser.h:983
#define TB_GETBUTTONSIZE
Definition: commctrl.h:1156
GLsizeiptr size
Definition: glext.h:5919
HTHEME m_Theme
Definition: traywnd.cpp:276
#define SWP_NOACTIVATE
Definition: winuser.h:1227
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND m_hWnd
Definition: atlwin.h:268
#define ERR(fmt,...)
Definition: debug.h:109
#define TSWM_UPDATETASKBARPOS
Definition: precomp.h:347
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND m_TaskSwitch
Definition: traywnd.cpp:282
HRESULT WINAPI GetWindow(HWND *phwnd)
Definition: traywnd.cpp:3221
#define HIWORD(l)
Definition: typedefs.h:246
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
VOID UpdateSize()
Definition: traywnd.cpp:167
LONG bottom
Definition: windef.h:294
HDWP DeferWindowPos(HDWP hWinPosInfo, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags)
Definition: atlwin.h:422
LONG cy
Definition: windef.h:320

Referenced by OnSettingChanged(), OnSize(), and Open().

◆ ApplyClipping()

VOID CTrayWindow::ApplyClipping ( IN BOOL  Clip)
inline

Definition at line 1393 of file traywnd.cpp.

1394  {
1395  RECT rcClip, rcWindow;
1396  HRGN hClipRgn;
1397 
1398  if (GetWindowRect(&rcWindow))
1399  {
1400  /* Disable clipping on systems with only one monitor */
1401  if (GetSystemMetrics(SM_CMONITORS) <= 1)
1402  Clip = FALSE;
1403 
1404  if (Clip)
1405  {
1406  rcClip = rcWindow;
1407 
1408  GetScreenRect(m_Monitor, &rcClip);
1409 
1410  if (!IntersectRect(&rcClip, &rcClip, &rcWindow))
1411  {
1412  rcClip = rcWindow;
1413  }
1414 
1415  OffsetRect(&rcClip,
1416  -rcWindow.left,
1417  -rcWindow.top);
1418 
1419  hClipRgn = CreateRectRgnIndirect(&rcClip);
1420  }
1421  else
1422  hClipRgn = NULL;
1423 
1424  /* Set the clipping region or make sure the window isn't clipped
1425  by disabling it explicitly. */
1426  SetWindowRgn(hClipRgn, TRUE);
1427  }
1428  }
#define TRUE
Definition: types.h:120
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define SM_CMONITORS
Definition: winuser.h:1030
HRGN WINAPI CreateRectRgnIndirect(_In_ LPCRECT)
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:764
smooth NULL
Definition: ftsmooth.c:416
int SetWindowRgn(HRGN hRgn, BOOL bRedraw=FALSE)
Definition: atlwin.h:1226
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
HMONITOR m_Monitor
Definition: traywnd.cpp:288
HMONITOR GetScreenRect(IN HMONITOR hMonitor, IN OUT RECT *pRect)
Definition: traywnd.cpp:1006

Referenced by CheckTrayWndPosition(), Lock(), OnEnterSizeMove(), and OnSize().

◆ CalculateValidSize()

HMONITOR CTrayWindow::CalculateValidSize ( IN DWORD  Position,
IN OUT RECT pRect 
)
inline

Definition at line 1124 of file traywnd.cpp.

1127  {
1128  RECT rcScreen;
1129  //BOOL Horizontal;
1130  HMONITOR hMon;
1131  SIZE szMax, szWnd;
1132 
1133  //Horizontal = IsPosHorizontal();
1134 
1135  szWnd.cx = pRect->right - pRect->left;
1136  szWnd.cy = pRect->bottom - pRect->top;
1137 
1138  rcScreen = *pRect;
1139  hMon = GetScreenRectFromRect(
1140  &rcScreen,
1141  MONITOR_DEFAULTTONEAREST);
1142 
1143  /* Calculate the maximum size of the tray window and limit the window
1144  size to half of the screen's size. */
1145  szMax.cx = (rcScreen.right - rcScreen.left) / 2;
1146  szMax.cy = (rcScreen.bottom - rcScreen.top) / 2;
1147  if (szWnd.cx > szMax.cx)
1148  szWnd.cx = szMax.cx;
1149  if (szWnd.cy > szMax.cy)
1150  szWnd.cy = szMax.cy;
1151 
1152  /* FIXME - calculate */
1153 
1155  &rcScreen,
1156  &szWnd,
1157  pRect);
1158 
1159  return hMon;
1160  }
VOID GetTrayRectFromScreenRect(IN DWORD Position, IN const RECT *pScreen, IN const SIZE *pTraySize OPTIONAL, OUT RECT *pRect)
Definition: traywnd.cpp:1098
static COORD Position
Definition: mouse.c:34
LONG top
Definition: windef.h:292
HMONITOR GetScreenRectFromRect(IN OUT RECT *pRect, IN DWORD dwFlags)
Definition: traywnd.cpp:954
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
LONG cx
Definition: windef.h:319
LONG bottom
Definition: windef.h:294
LONG cy
Definition: windef.h:320

Referenced by FitToRebar().

◆ ChangingWinPos()

VOID CTrayWindow::ChangingWinPos ( IN OUT LPWINDOWPOS  pwp)
inline

Definition at line 1301 of file traywnd.cpp.

1302  {
1303  RECT rcTray;
1304 
1305  if (IsDragging)
1306  {
1307  rcTray.left = pwp->x;
1308  rcTray.top = pwp->y;
1309  rcTray.right = rcTray.left + pwp->cx;
1310  rcTray.bottom = rcTray.top + pwp->cy;
1311 
1312  if (!EqualRect(&rcTray,
1314  {
1315  /* Recalculate the rectangle, the user dragged the tray
1316  window to another monitor or the window was somehow else
1317  moved or resized */
1319  &rcTray,
1321  //m_TrayRects[DraggingPosition] = rcTray;
1322  }
1323 
1324  //Monitor = CalculateValidSize(DraggingPosition,
1325  // &rcTray);
1326 
1329  IsDragging = FALSE;
1330 
1331  m_TrayRects[m_Position] = rcTray;
1332  goto ChangePos;
1333  }
1334  else if (GetWindowRect(&rcTray))
1335  {
1336  if (InSizeMove)
1337  {
1338  if (!(pwp->flags & SWP_NOMOVE))
1339  {
1340  rcTray.left = pwp->x;
1341  rcTray.top = pwp->y;
1342  }
1343 
1344  if (!(pwp->flags & SWP_NOSIZE))
1345  {
1346  rcTray.right = rcTray.left + pwp->cx;
1347  rcTray.bottom = rcTray.top + pwp->cy;
1348  }
1349 
1351 
1352  if (!(pwp->flags & (SWP_NOMOVE | SWP_NOSIZE)))
1353  {
1354  SIZE szWnd;
1355 
1356  szWnd.cx = pwp->cx;
1357  szWnd.cy = pwp->cy;
1358 
1359  MakeTrayRectWithSize(m_Position, &szWnd, &rcTray);
1360  }
1361 
1362  m_TrayRects[m_Position] = rcTray;
1363  }
1364  else
1365  {
1366  /* If the user isn't resizing the tray window we need to make sure the
1367  new size or position is valid. this is to prevent changes to the window
1368  without user interaction. */
1369  rcTray = m_TrayRects[m_Position];
1370 
1372  {
1373  rcTray.left += m_AutoHideOffset.cx;
1374  rcTray.right += m_AutoHideOffset.cx;
1375  rcTray.top += m_AutoHideOffset.cy;
1376  rcTray.bottom += m_AutoHideOffset.cy;
1377  }
1378 
1379  }
1380 
1381 ChangePos:
1382  m_TraySize.cx = rcTray.right - rcTray.left;
1383  m_TraySize.cy = rcTray.bottom - rcTray.top;
1384 
1385  pwp->flags &= ~(SWP_NOMOVE | SWP_NOSIZE);
1386  pwp->x = rcTray.left;
1387  pwp->y = rcTray.top;
1388  pwp->cx = m_TraySize.cx;
1389  pwp->cy = m_TraySize.cy;
1390  }
1391  }
DWORD IsDragging
Definition: traywnd.cpp:315
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
DWORD m_Position
Definition: traywnd.cpp:287
LONG right
Definition: windef.h:293
TW_STRUCKRECTS2 sr
Definition: precomp.h:209
DWORD InSizeMove
Definition: traywnd.cpp:314
VOID MakeTrayRectWithSize(IN DWORD Position, IN const SIZE *pTraySize, IN OUT RECT *pRect)
Definition: traywnd.cpp:1073
DWORD AutoHide
Definition: precomp.h:192
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:764
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
LONG cx
Definition: windef.h:319
RECT m_TrayRects[4]
Definition: traywnd.cpp:293
DWORD m_DraggingPosition
Definition: traywnd.cpp:290
HMONITOR m_DraggingMonitor
Definition: traywnd.cpp:291
DWORD GetDraggingRectFromRect(IN OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1283
#define SWP_NOSIZE
Definition: winuser.h:1230
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
HMONITOR m_Monitor
Definition: traywnd.cpp:288
SIZE m_AutoHideOffset
Definition: traywnd.cpp:300
LONG bottom
Definition: windef.h:294
#define SWP_NOMOVE
Definition: winuser.h:1229
LONG cy
Definition: windef.h:320
SIZE m_TraySize
Definition: traywnd.cpp:294

Referenced by OnWindowPosChanging().

◆ CheckTrayWndPosition()

VOID CTrayWindow::CheckTrayWndPosition ( )
inline

Definition at line 1482 of file traywnd.cpp.

1483  {
1484  /* Force the rebar bands to resize */
1486  IID_IDeskBand,
1488  0,
1489  NULL,
1490  NULL);
1491 
1492  /* Calculate the size of the taskbar based on the rebar */
1494 
1495  /* Move the tray window */
1496  /* The handler of WM_WINDOWPOSCHANGING will override whatever size
1497  * and position we use here with m_TrayRects */
1498  SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOACTIVATE);
1499  ResizeWorkArea();
1501  }
#define TRUE
Definition: types.h:120
void FitToRebar(PRECT pRect)
Definition: traywnd.cpp:1726
BOOL SetWindowPos(HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
Definition: atlwin.h:1220
CComPtr< ITrayBandSite > m_TrayBandSite
Definition: traywnd.cpp:306
#define SWP_NOZORDER
Definition: winuser.h:1232
DWORD m_Position
Definition: traywnd.cpp:287
smooth NULL
Definition: ftsmooth.c:416
RECT m_TrayRects[4]
Definition: traywnd.cpp:293
#define SWP_NOACTIVATE
Definition: winuser.h:1227
VOID ApplyClipping(IN BOOL Clip)
Definition: traywnd.cpp:1393
VOID ResizeWorkArea()
Definition: traywnd.cpp:1430
HRESULT WINAPI IUnknown_Exec(IUnknown *lpUnknown, REFGUID pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: ordinal.c:1034

Referenced by OnDisplayChange(), OnSettingChanged(), and Open().

◆ Close()

HRESULT STDMETHODCALLTYPE CTrayWindow::Close ( )
inline

Definition at line 2081 of file traywnd.cpp.

2082  {
2083  if (m_hWnd != NULL)
2084  {
2087  0,
2088  0);
2089  }
2090 
2091  return S_OK;
2092  }
smooth NULL
Definition: ftsmooth.c:416
HWND m_hWnd
Definition: atlwin.h:268
#define S_OK
Definition: intsafe.h:59
#define WM_APP_TRAYDESTROY
Definition: traywnd.cpp:27
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048

◆ ContextSensitiveHelp()

HRESULT WINAPI CTrayWindow::ContextSensitiveHelp ( BOOL  fEnterMode)
inline

Implements IOleWindow.

Definition at line 3229 of file traywnd.cpp.

3230  {
3231  return E_NOTIMPL;
3232  }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DisplayProperties()

HWND STDMETHODCALLTYPE CTrayWindow::DisplayProperties ( )
inline

Definition at line 514 of file traywnd.cpp.

515  {
516  HWND hTrayProp;
517 
519  {
521  if (hTrayProp != NULL &&
522  hTrayProp != m_TrayPropertiesOwner)
523  {
524  SetForegroundWindow(hTrayProp);
525  return NULL;
526  }
527  }
528 
530  return NULL;
531  }
static DWORD WINAPI s_TrayPropertiesThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:507
#define CloseHandle
Definition: compat.h:406
HWND GetLastActivePopup() const
Definition: atlwin.h:630
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
HWND m_TrayPropertiesOwner
Definition: traywnd.cpp:296
BOOL WINAPI SetForegroundWindow(_In_ HWND)

Referenced by ExecContextMenuCmd(), and HandleCommand().

◆ DisplayRunFileDlg()

void CTrayWindow::DisplayRunFileDlg ( )
inline

Definition at line 461 of file traywnd.cpp.

462  {
463  HWND hRunDlg;
464  if (m_RunFileDlgOwner)
465  {
467  if (hRunDlg != NULL &&
468  hRunDlg != m_RunFileDlgOwner)
469  {
470  SetForegroundWindow(hRunDlg);
471  return;
472  }
473  }
474 
476  }
HWND m_RunFileDlgOwner
Definition: traywnd.cpp:297
#define CloseHandle
Definition: compat.h:406
HWND GetLastActivePopup() const
Definition: atlwin.h:630
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
static DWORD WINAPI s_RunFileDlgThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:455
BOOL WINAPI SetForegroundWindow(_In_ HWND)

Referenced by HandleCommand(), and HandleHotKey().

◆ DoExitWindows()

LRESULT CTrayWindow::DoExitWindows ( )
inline

Definition at line 401 of file traywnd.cpp.

402  {
403  /* Display the ReactOS Shutdown Dialog */
405 
406  /*
407  * If the user presses CTRL+ALT+SHIFT while exiting
408  * the shutdown dialog, exit the shell cleanly.
409  */
410  if ((GetKeyState(VK_CONTROL) & 0x8000) &&
411  (GetKeyState(VK_SHIFT) & 0x8000) &&
412  (GetKeyState(VK_MENU) & 0x8000))
413  {
414  PostMessage(WM_QUIT, 0, 0);
415  }
416  return 0;
417  }
#define WM_QUIT
Definition: winuser.h:1605
#define VK_MENU
Definition: winuser.h:2179
#define VK_SHIFT
Definition: winuser.h:2177
SHORT WINAPI GetKeyState(_In_ int)
void WINAPI ExitWindowsDialog(HWND hWndOwner)
Definition: dialogs.cpp:1145
HWND m_hWnd
Definition: atlwin.h:268
BOOL PostMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:976
#define VK_CONTROL
Definition: winuser.h:2178

Referenced by HandleCommand(), OnDoExitWindows(), and OnSysCommand().

◆ DrawSizerWithTheme()

int CTrayWindow::DrawSizerWithTheme ( IN HRGN  hRgn)
inline

Definition at line 1996 of file traywnd.cpp.

1997  {
1998  HDC hdc;
1999  RECT rect;
2001  SIZE size;
2002 
2004 
2005  HRESULT hr = GetThemePartSize(m_Theme, NULL, iSizerPart[m_Position], 0, NULL, TS_TRUE, &size);
2006  if (FAILED_UNEXPECTEDLY(hr))
2007  return 0;
2008 
2009  GetWindowRect(&rect);
2010  OffsetRect(&rect, -rect.left, -rect.top);
2011 
2012  hdc = GetWindowDC();
2013 
2014  switch (m_Position)
2015  {
2016  case ABE_LEFT:
2017  rect.left = rect.right - size.cx;
2018  break;
2019  case ABE_TOP:
2020  rect.top = rect.bottom - size.cy;
2021  break;
2022  case ABE_RIGHT:
2023  rect.right = rect.left + size.cx;
2024  break;
2025  case ABE_BOTTOM:
2026  default:
2027  rect.bottom = rect.top + size.cy;
2028  break;
2029  }
2030 
2031  DrawThemeBackground(m_Theme, hdc, iSizerPart[m_Position], 0, &rect, 0);
2032 
2033  ReleaseDC(hdc);
2034  return 0;
2035  }
HRESULT WINAPI GetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, THEMESIZE eSize, SIZE *psz)
Definition: draw.c:1777
#define ABE_TOP
Definition: shellapi.h:18
HRESULT hr
Definition: shlfolder.c:183
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
static HDC
Definition: imagelist.c:92
DWORD m_Position
Definition: traywnd.cpp:287
#define ABE_LEFT
Definition: shellapi.h:17
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
& rect
Definition: startmenu.cpp:1413
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:764
smooth NULL
Definition: ftsmooth.c:416
#define ABE_RIGHT
Definition: shellapi.h:19
GLsizeiptr size
Definition: glext.h:5919
HTHEME m_Theme
Definition: traywnd.cpp:276
LONG HRESULT
Definition: typedefs.h:77
HDC GetWindowDC()
Definition: atlwin.h:732
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
HDC hdc
Definition: main.c:9
int ReleaseDC(HDC hDC)
Definition: atlwin.h:1006
#define ABE_BOTTOM
Definition: shellapi.h:20

Referenced by OnNcPaint().

◆ EraseBackgroundWithTheme()

LRESULT CTrayWindow::EraseBackgroundWithTheme ( HDC  hdc)
inline

Definition at line 1980 of file traywnd.cpp.

1981  {
1982  RECT rect;
1984 
1986 
1987  if (m_Theme)
1988  {
1989  GetClientRect(&rect);
1990  DrawThemeBackground(m_Theme, hdc, iSBkgndPart[m_Position], 0, &rect, 0);
1991  }
1992 
1993  return 0;
1994  }
DWORD m_Position
Definition: traywnd.cpp:287
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
& rect
Definition: startmenu.cpp:1413
BOOL GetClientRect(LPRECT lpRect) const
Definition: atlwin.h:507
HTHEME m_Theme
Definition: traywnd.cpp:276
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
HDC hdc
Definition: main.c:9
#define ABE_BOTTOM
Definition: shellapi.h:20

Referenced by OnEraseBackground().

◆ ExecContextMenuCmd()

BOOL STDMETHODCALLTYPE CTrayWindow::ExecContextMenuCmd ( IN UINT  uiCmd)
inline

Definition at line 573 of file traywnd.cpp.

574  {
575  switch (uiCmd)
576  {
579  break;
580 
583  TEXT("open"));
584  break;
585 
588  TEXT("explore"));
589  break;
590 
591  case ID_LOCKTASKBAR:
593  {
595  }
596  break;
597 
600  break;
601 
603  break;
604 
606  ShowDesktop();
607  break;
608 
611  break;
612 
615  break;
616 
619  break;
620 
623  break;
624 
626  //FIXME: Use SHRunControlPanel
627  ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
628  break;
629 
631  RestoreAll();
632  break;
633 
634  default:
635  TRACE("ITrayWindow::ExecContextMenuCmd(%u): Unhandled Command ID!\n", uiCmd);
636  return FALSE;
637  }
638 
639  return TRUE;
640  }
#define SW_NORMAL
Definition: winuser.h:763
#define TRUE
Definition: types.h:120
WORD WINAPI TileWindows(_In_opt_ HWND hwndParent, _In_ UINT wHow, _In_opt_ CONST RECT *lpRect, _In_ UINT cKids, _In_reads_opt_(cKids) const HWND FAR *lpKids)
#define ID_SHELL_CMD_PROPERTIES
Definition: resource.h:185
#define ID_SHELL_CMD_RESTORE_ALL
Definition: resource.h:197
#define ID_SHELL_CMD_UNDO_ACTION
Definition: resource.h:190
#define ID_SHELL_CMD_OPEN_TASKMGR
Definition: resource.h:189
VOID ShowCustomizeNotifyIcons(HINSTANCE hInst, HWND hExplorer)
#define ID_SHELL_CMD_SHOW_DESKTOP
Definition: resource.h:191
VOID RestoreAll()
Definition: traywnd.cpp:2884
#define ID_SHELL_CMD_CUST_NOTIF
Definition: resource.h:195
#define ID_SHELL_CMD_CASCADE_WND
Definition: resource.h:194
HWND STDMETHODCALLTYPE DisplayProperties()
Definition: traywnd.cpp:514
VOID OpenTaskManager(IN HWND hWndOwner)
Definition: traywnd.cpp:551
#define MDITILE_HORIZONTAL
Definition: winuser.h:2163
VOID OpenCommonStartMenuDirectory(IN HWND hWndOwner, IN LPCTSTR lpOperation)
Definition: traywnd.cpp:533
smooth NULL
Definition: ftsmooth.c:416
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
#define ID_SHELL_CMD_EXPLORE_ALL_USERS
Definition: resource.h:187
#define TRACE(s)
Definition: solgame.cpp:4
#define MDITILE_SKIPDISABLED
Definition: winuser.h:2162
#define MDITILE_VERTICAL
Definition: winuser.h:2164
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
static const WCHAR L[]
Definition: oid.c:1250
HWND m_hWnd
Definition: atlwin.h:268
#define ID_SHELL_CMD_OPEN_ALL_USERS
Definition: resource.h:186
#define ID_SHELL_CMD_TILE_WND_H
Definition: resource.h:193
#define TEXT(s)
Definition: k32.h:26
VOID ShowDesktop()
Definition: traywnd.cpp:2879
WORD WINAPI CascadeWindows(_In_opt_ HWND hwndParent, _In_ UINT wHow, _In_opt_ CONST RECT *lpRect, _In_ UINT cKids, _In_reads_opt_(cKids) const HWND FAR *lpKids)
#define ID_LOCKTASKBAR
Definition: resource.h:188
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2246
#define ID_SHELL_CMD_ADJUST_DAT
Definition: resource.h:196
DWORD WINAPI SHRestricted(RESTRICTIONS policy)
Definition: shpolicy.c:836
#define ID_SHELL_CMD_TILE_WND_V
Definition: resource.h:192

◆ ExecResourceCmd()

HRESULT CTrayWindow::ExecResourceCmd ( int  id)
inline

Definition at line 377 of file traywnd.cpp.

378  {
379  WCHAR szCommand[256];
380  WCHAR *pszParameters;
381 
383  id,
384  szCommand,
385  _countof(szCommand)))
386  {
387  return E_FAIL;
388  }
389 
390  pszParameters = wcschr(szCommand, L'>');
391  if (pszParameters)
392  {
393  *pszParameters = 0;
394  pszParameters++;
395  }
396 
397  ShellExecuteW(m_hWnd, NULL, szCommand, pszParameters, NULL, SW_SHOWNORMAL);
398  return S_OK;
399  }
#define _countof(array)
Definition: fontsub.cpp:30
#define E_FAIL
Definition: ddrawi.h:102
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
smooth NULL
Definition: ftsmooth.c:416
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
__wchar_t WCHAR
Definition: xmlstorage.h:180
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
static const WCHAR L[]
Definition: oid.c:1250
HWND m_hWnd
Definition: atlwin.h:268
#define S_OK
Definition: intsafe.h:59
#define SW_SHOWNORMAL
Definition: winuser.h:764
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2246

Referenced by HandleCommand(), and HandleHotKey().

◆ FitToRebar()

void CTrayWindow::FitToRebar ( PRECT  pRect)
inline

Definition at line 1726 of file traywnd.cpp.

1727  {
1728  /* Get the rect of the rebar */
1729  RECT rebarRect, taskbarRect, clientRect;
1730  ::GetWindowRect(m_Rebar, &rebarRect);
1731  ::GetWindowRect(m_hWnd, &taskbarRect);
1732  ::GetClientRect(m_hWnd, &clientRect);
1733  OffsetRect(&rebarRect, -taskbarRect.left, -taskbarRect.top);
1734 
1735  /* Calculate the difference of size of the taskbar and the rebar */
1736  SIZE margins;
1737  margins.cx = taskbarRect.right - taskbarRect.left - clientRect.right + clientRect.left;
1738  margins.cy = taskbarRect.bottom - taskbarRect.top - clientRect.bottom + clientRect.top;
1739 
1740  /* Calculate the new size of the rebar and make it resize, then change the new taskbar size */
1741  switch (m_Position)
1742  {
1743  case ABE_TOP:
1744  rebarRect.bottom = rebarRect.top + pRect->bottom - pRect->top - margins.cy;
1746  pRect->bottom = pRect->top + rebarRect.bottom - rebarRect.top + margins.cy;
1747  break;
1748  case ABE_BOTTOM:
1749  rebarRect.top = rebarRect.bottom - (pRect->bottom - pRect->top - margins.cy);
1751  pRect->top = pRect->bottom - (rebarRect.bottom - rebarRect.top + margins.cy);
1752  break;
1753  case ABE_LEFT:
1754  rebarRect.right = rebarRect.left + (pRect->right - pRect->left - margins.cx);
1756  pRect->right = pRect->left + (rebarRect.right - rebarRect.left + margins.cx);
1757  break;
1758  case ABE_RIGHT:
1759  rebarRect.left = rebarRect.right - (pRect->right - pRect->left - margins.cx);
1761  pRect->left = pRect->right - (rebarRect.right - rebarRect.left + margins.cx);
1762  break;
1763  }
1764 
1766  }
#define ABE_TOP
Definition: shellapi.h:18
#define RB_SIZETORECT
Definition: commctrl.h:1594
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
DWORD m_Position
Definition: traywnd.cpp:287
HMONITOR CalculateValidSize(IN DWORD Position, IN OUT RECT *pRect)
Definition: traywnd.cpp:1124
LONG right
Definition: windef.h:293
#define ABE_LEFT
Definition: shellapi.h:17
HWND m_Rebar
Definition: traywnd.cpp:281
BOOL GetClientRect(LPRECT lpRect) const
Definition: atlwin.h:507
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:764
#define ABE_RIGHT
Definition: shellapi.h:19
LONG_PTR LPARAM
Definition: windef.h:208
HWND m_hWnd
Definition: atlwin.h:268
static RECT margins
Definition: print.c:55
#define RBSTR_CHANGERECT
Definition: commctrl.h:1592
#define ABE_BOTTOM
Definition: shellapi.h:20
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG bottom
Definition: windef.h:294

Referenced by CheckTrayWndPosition(), OnExitSizeMove(), and OnSizing().

◆ GetCommandString()

HRESULT STDMETHODCALLTYPE CTrayWindow::GetCommandString ( UINT_PTR  idCmd,
UINT  uType,
UINT pwReserved,
LPSTR  pszName,
UINT  cchMax 
)
inline

Implements IContextMenu.

Definition at line 2188 of file traywnd.cpp.

2193  {
2194  if (!m_ContextMenu)
2195  return E_INVALIDARG;
2196 
2197  return m_ContextMenu->GetCommandString(idCmd, uType, pwReserved, pszName, cchMax);
2198  }
CComPtr< IContextMenu > m_ContextMenu
Definition: traywnd.cpp:275
#define E_INVALIDARG
Definition: ddrawi.h:101
UINT cchMax

◆ GetDraggingRectFromPt()

DWORD CTrayWindow::GetDraggingRectFromPt ( IN POINT  pt,
OUT RECT pRect,
OUT HMONITOR phMonitor 
)
inline

Definition at line 1181 of file traywnd.cpp.

1185  {
1186  HMONITOR hMon, hMonNew;
1187  DWORD PosH, PosV, Pos;
1188  SIZE DeltaPt, ScreenOffset;
1189  RECT rcScreen;
1190 
1191  rcScreen.left = 0;
1192  rcScreen.top = 0;
1193 
1194  /* Determine the screen rectangle */
1195  hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONULL);
1196  if (hMon != NULL)
1197  {
1198  MONITORINFO mi;
1199 
1200  mi.cbSize = sizeof(mi);
1201  if (!GetMonitorInfo(hMon, &mi))
1202  {
1203  hMon = NULL;
1204  goto GetPrimaryScreenRect;
1205  }
1206 
1207  /* make left top corner of the screen zero based to
1208  make calculations easier */
1209  pt.x -= mi.rcMonitor.left;
1210  pt.y -= mi.rcMonitor.top;
1211 
1212  ScreenOffset.cx = mi.rcMonitor.left;
1213  ScreenOffset.cy = mi.rcMonitor.top;
1214  rcScreen.right = mi.rcMonitor.right - mi.rcMonitor.left;
1215  rcScreen.bottom = mi.rcMonitor.bottom - mi.rcMonitor.top;
1216  }
1217  else
1218  {
1219 GetPrimaryScreenRect:
1220  ScreenOffset.cx = 0;
1221  ScreenOffset.cy = 0;
1222  rcScreen.right = GetSystemMetrics(SM_CXSCREEN);
1223  rcScreen.bottom = GetSystemMetrics(SM_CYSCREEN);
1224  }
1225 
1226  /* Calculate the nearest screen border */
1227  if (pt.x < rcScreen.right / 2)
1228  {
1229  DeltaPt.cx = pt.x;
1230  PosH = ABE_LEFT;
1231  }
1232  else
1233  {
1234  DeltaPt.cx = rcScreen.right - pt.x;
1235  PosH = ABE_RIGHT;
1236  }
1237 
1238  if (pt.y < rcScreen.bottom / 2)
1239  {
1240  DeltaPt.cy = pt.y;
1241  PosV = ABE_TOP;
1242  }
1243  else
1244  {
1245  DeltaPt.cy = rcScreen.bottom - pt.y;
1246  PosV = ABE_BOTTOM;
1247  }
1248 
1249  Pos = (DeltaPt.cx * rcScreen.bottom < DeltaPt.cy * rcScreen.right) ? PosH : PosV;
1250 
1251  /* Fix the screen origin to be relative to the primary monitor again */
1252  OffsetRect(&rcScreen,
1253  ScreenOffset.cx,
1254  ScreenOffset.cy);
1255 
1256  RECT rcPos = m_TrayRects[Pos];
1257 
1258  hMonNew = GetMonitorFromRect(&rcPos);
1259  if (hMon != hMonNew)
1260  {
1261  SIZE szTray;
1262 
1263  /* Recalculate the rectangle, we're dragging to another monitor.
1264  We don't need to recalculate the rect on single monitor systems. */
1265  szTray.cx = rcPos.right - rcPos.left;
1266  szTray.cy = rcPos.bottom - rcPos.top;
1267 
1268  GetTrayRectFromScreenRect(Pos, &rcScreen, &szTray, pRect);
1269  hMon = hMonNew;
1270  }
1271  else
1272  {
1273  /* The user is dragging the tray window on the same monitor. We don't need
1274  to recalculate the rectangle */
1275  *pRect = rcPos;
1276  }
1277 
1278  *phMonitor = hMon;
1279 
1280  return Pos;
1281  }
HMONITOR WINAPI MonitorFromPoint(POINT, DWORD)
HMONITOR GetMonitorFromRect(IN const RECT *pRect)
Definition: traywnd.cpp:981
#define ABE_TOP
Definition: shellapi.h:18
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
VOID GetTrayRectFromScreenRect(IN DWORD Position, IN const RECT *pScreen, IN const SIZE *pTraySize OPTIONAL, OUT RECT *pRect)
Definition: traywnd.cpp:1098
#define pt(x, y)
Definition: drawing.c:79
ush Pos
Definition: deflate.h:92
LONG top
Definition: windef.h:292
static MONITORINFO mi
Definition: win.c:7331
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
#define ABE_LEFT
Definition: shellapi.h:17
RECT rcMonitor
Definition: winuser.h:3759
#define SM_CXSCREEN
Definition: winuser.h:949
smooth NULL
Definition: ftsmooth.c:416
#define ABE_RIGHT
Definition: shellapi.h:19
LONG cx
Definition: windef.h:319
RECT m_TrayRects[4]
Definition: traywnd.cpp:293
#define GetMonitorInfo
Definition: winuser.h:5692
#define SM_CYSCREEN
Definition: winuser.h:950
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ABE_BOTTOM
Definition: shellapi.h:20
DWORD cbSize
Definition: winuser.h:3758
LONG bottom
Definition: windef.h:294
LONG cy
Definition: windef.h:320

Referenced by GetDraggingRectFromRect(), and OnMoving().

◆ GetDraggingRectFromRect()

DWORD CTrayWindow::GetDraggingRectFromRect ( IN OUT RECT pRect,
OUT HMONITOR phMonitor 
)
inline

Definition at line 1283 of file traywnd.cpp.

1286  {
1287  POINT pt;
1288 
1289  /* Calculate the center of the rectangle. We call
1290  GetDraggingRectFromPt to calculate a valid
1291  dragging rectangle */
1292  pt.x = pRect->left + ((pRect->right - pRect->left) / 2);
1293  pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2);
1294 
1295  return GetDraggingRectFromPt(
1296  pt,
1297  pRect,
1298  phMonitor);
1299  }
#define pt(x, y)
Definition: drawing.c:79
DWORD GetDraggingRectFromPt(IN POINT pt, OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1181

Referenced by ChangingWinPos().

◆ GetHWND()

HWND STDMETHODCALLTYPE CTrayWindow::GetHWND ( )
inline

Definition at line 2094 of file traywnd.cpp.

2095  {
2096  return m_hWnd;
2097  }
HWND m_hWnd
Definition: atlwin.h:268

◆ GetMonitorFromRect()

HMONITOR CTrayWindow::GetMonitorFromRect ( IN const RECT pRect)
inline

Definition at line 981 of file traywnd.cpp.

983  {
984  HMONITOR hMon;
985 
986  /* In case the monitor sizes or saved sizes differ a bit (probably
987  not a lot, only so the tray window overlaps into another monitor
988  now), minimize the risk that we determine a wrong monitor by
989  using the center point of the tray window if we can't determine
990  it using the rectangle. */
991  hMon = MonitorFromRect(pRect, MONITOR_DEFAULTTONULL);
992  if (hMon == NULL)
993  {
994  POINT pt;
995 
996  pt.x = pRect->left + ((pRect->right - pRect->left) / 2);
997  pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2);
998 
999  /* be less error-prone, find the nearest monitor */
1000  hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);
1001  }
1002 
1003  return hMon;
1004  }
HMONITOR WINAPI MonitorFromPoint(POINT, DWORD)
#define pt(x, y)
Definition: drawing.c:79
smooth NULL
Definition: ftsmooth.c:416
HMONITOR WINAPI MonitorFromRect(LPCRECT, DWORD)

Referenced by GetDraggingRectFromPt(), GetScreenRect(), and RegLoadSettings().

◆ GetScreenRect()

HMONITOR CTrayWindow::GetScreenRect ( IN HMONITOR  hMonitor,
IN OUT RECT pRect 
)
inline

Definition at line 1006 of file traywnd.cpp.

1009  {
1010  HMONITOR hMon = NULL;
1011 
1012  if (hMonitor != NULL)
1013  {
1014  MONITORINFO mi;
1015 
1016  mi.cbSize = sizeof(mi);
1017  if (!GetMonitorInfo(hMonitor, &mi))
1018  {
1019  /* Hm, the monitor is gone? Try to find a monitor where it
1020  could be located now */
1021  hMon = GetMonitorFromRect(pRect);
1022  if (hMon == NULL ||
1023  !GetMonitorInfo(hMon, &mi))
1024  {
1025  hMon = NULL;
1026  goto GetPrimaryRect;
1027  }
1028  }
1029 
1030  *pRect = mi.rcMonitor;
1031  }
1032  else
1033  {
1034 GetPrimaryRect:
1035  pRect->left = 0;
1036  pRect->top = 0;
1037  pRect->right = GetSystemMetrics(SM_CXSCREEN);
1038  pRect->bottom = GetSystemMetrics(SM_CYSCREEN);
1039  }
1040 
1041  return hMon;
1042  }
HMONITOR GetMonitorFromRect(IN const RECT *pRect)
Definition: traywnd.cpp:981
static MONITORINFO mi
Definition: win.c:7331
LONG left
Definition: windef.h:291
RECT rcMonitor
Definition: winuser.h:3759
#define SM_CXSCREEN
Definition: winuser.h:949
smooth NULL
Definition: ftsmooth.c:416
#define GetMonitorInfo
Definition: winuser.h:5692
#define SM_CYSCREEN
Definition: winuser.h:950
int WINAPI GetSystemMetrics(_In_ int)
DWORD cbSize
Definition: winuser.h:3758

Referenced by ApplyClipping(), and ResizeWorkArea().

◆ GetScreenRectFromRect()

HMONITOR CTrayWindow::GetScreenRectFromRect ( IN OUT RECT pRect,
IN DWORD  dwFlags 
)
inline

Definition at line 954 of file traywnd.cpp.

957  {
958  MONITORINFO mi;
959  HMONITOR hMon;
960 
961  mi.cbSize = sizeof(mi);
962  hMon = MonitorFromRect(pRect, dwFlags);
963  if (hMon != NULL &&
964  GetMonitorInfo(hMon, &mi))
965  {
966  *pRect = mi.rcMonitor;
967  }
968  else
969  {
970  pRect->left = 0;
971  pRect->top = 0;
972  pRect->right = GetSystemMetrics(SM_CXSCREEN);
973  pRect->bottom = GetSystemMetrics(SM_CYSCREEN);
974 
975  hMon = NULL;
976  }
977 
978  return hMon;
979  }
static MONITORINFO mi
Definition: win.c:7331
LONG left
Definition: windef.h:291
RECT rcMonitor
Definition: winuser.h:3759
#define SM_CXSCREEN
Definition: winuser.h:949
smooth NULL
Definition: ftsmooth.c:416
#define GetMonitorInfo
Definition: winuser.h:5692
#define SM_CYSCREEN
Definition: winuser.h:950
int WINAPI GetSystemMetrics(_In_ int)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
DWORD cbSize
Definition: winuser.h:3758
HMONITOR WINAPI MonitorFromRect(LPCRECT, DWORD)

Referenced by CalculateValidSize(), and RegLoadSettings().

◆ GetState()

virtual ULONG STDMETHODCALLTYPE CTrayWindow::GetState ( )
inlinevirtual

Definition at line 3187 of file traywnd.cpp.

3188  {
3189  /* FIXME: Return ABS_ flags? */
3190  TRACE("IShellDesktopTray::GetState() unimplemented!\n");
3191  return 0;
3192  }
#define TRACE(s)
Definition: solgame.cpp:4

◆ GetTrayRectFromScreenRect()

VOID CTrayWindow::GetTrayRectFromScreenRect ( IN DWORD  Position,
IN const RECT pScreen,
IN const SIZE *pTraySize  OPTIONAL,
OUT RECT pRect 
)
inline

Definition at line 1098 of file traywnd.cpp.

1102  {
1103  if (pTraySize == NULL)
1104  pTraySize = &m_TraySize;
1105 
1106  *pRect = *pScreen;
1107 
1108  if(!m_Theme)
1109  {
1110  /* Move the border outside of the screen */
1111  InflateRect(pRect,
1114  }
1115 
1116  MakeTrayRectWithSize(Position, pTraySize, pRect);
1117  }
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
static COORD Position
Definition: mouse.c:34
#define SM_CXEDGE
Definition: winuser.h:998
VOID MakeTrayRectWithSize(IN DWORD Position, IN const SIZE *pTraySize, IN OUT RECT *pRect)
Definition: traywnd.cpp:1073
smooth NULL
Definition: ftsmooth.c:416
#define SM_CYEDGE
Definition: winuser.h:999
HTHEME m_Theme
Definition: traywnd.cpp:276
int WINAPI GetSystemMetrics(_In_ int)
SIZE m_TraySize
Definition: traywnd.cpp:294

Referenced by CalculateValidSize(), GetDraggingRectFromPt(), and RegLoadSettings().

◆ GetTrayWindow()

virtual HRESULT STDMETHODCALLTYPE CTrayWindow::GetTrayWindow ( OUT HWND phWndTray)
inlinevirtual

Definition at line 3194 of file traywnd.cpp.

3195  {
3196  TRACE("IShellDesktopTray::GetTrayWindow(0x%p)\n", phWndTray);
3197  *phWndTray = m_hWnd;
3198  return S_OK;
3199  }
#define TRACE(s)
Definition: solgame.cpp:4
HWND m_hWnd
Definition: atlwin.h:268
#define S_OK
Definition: intsafe.h:59

◆ GetWindow()

HRESULT WINAPI CTrayWindow::GetWindow ( HWND phwnd)
inline

Implements IOleWindow.

Definition at line 3221 of file traywnd.cpp.

3222  {
3223  if (!phwnd)
3224  return E_INVALIDARG;
3225  *phwnd = m_hWnd;
3226  return S_OK;
3227  }
#define E_INVALIDARG
Definition: ddrawi.h:101
HWND m_hWnd
Definition: atlwin.h:268
#define S_OK
Definition: intsafe.h:59

Referenced by AlignControls(), and MinimizeWindowsProc().

◆ HandleCommand()

LRESULT CTrayWindow::HandleCommand ( UINT  uCommand)
inline

Definition at line 687 of file traywnd.cpp.

688  {
689  switch (uCommand)
690  {
691  case TRAYCMD_STARTMENU:
692  // TODO:
693  break;
694  case TRAYCMD_RUN_DIALOG:
696  break;
698  LogoffWindowsDialog(m_hWnd); // FIXME: Maybe handle it in a similar way as DoExitWindows?
699  break;
700  case TRAYCMD_CASCADE:
702  break;
703  case TRAYCMD_TILE_H:
705  break;
706  case TRAYCMD_TILE_V:
708  break;
710  ToggleDesktop();
711  break;
713  ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
714  break;
717  break;
719  MinimizeAll();
720  break;
721  case TRAYCMD_RESTORE_ALL:
722  RestoreAll();
723  break;
725  ShowDesktop();
726  break;
729  break;
731  break;
734  {
736  }
737  break;
740  break;
742  // TODO:
743  break;
745  DoExitWindows();
746  break;
748  // TODO:
749  break;
751  // TODO:
752  break;
754  // TODO:
755  break;
756  case IDM_SEARCH:
759  break;
762  break;
763 
764  default:
765  break;
766  }
767 
768  return FALSE;
769  }
EXTERN_C BOOL WINAPI SHFindComputer(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: stubs.cpp:33
#define TRAYCMD_HELP_AND_SUPPORT
Definition: undocshell.h:670
#define SW_NORMAL
Definition: winuser.h:763
WORD WINAPI TileWindows(_In_opt_ HWND hwndParent, _In_ UINT wHow, _In_opt_ CONST RECT *lpRect, _In_ UINT cKids, _In_reads_opt_(cKids) const HWND FAR *lpKids)
VOID RestoreAll()
Definition: traywnd.cpp:2884
#define TRAYCMD_TILE_V
Definition: undocshell.h:660
#define IDS_HELP_COMMAND
Definition: resource.h:102
#define TRAYCMD_RESTORE_ALL
Definition: undocshell.h:665
#define TRAYCMD_TOGGLE_DESKTOP
Definition: undocshell.h:661
HWND STDMETHODCALLTYPE DisplayProperties()
Definition: traywnd.cpp:514
#define TRAYCMD_SHOW_DESKTOP
Definition: undocshell.h:666
VOID OpenTaskManager(IN HWND hWndOwner)
Definition: traywnd.cpp:551
#define TRAYCMD_SHOW_TASK_MGR
Definition: undocshell.h:667
#define MDITILE_HORIZONTAL
Definition: winuser.h:2163
#define TRAYCMD_DATE_AND_TIME
Definition: undocshell.h:662
#define TRAYCMD_SEARCH_FILES
Definition: undocshell.h:676
smooth NULL
Definition: ftsmooth.c:416
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
#define TRAYCMD_MINIMIZE_ALL
Definition: undocshell.h:664
#define TRAYCMD_PRINTERS_AND_FAXES
Definition: undocshell.h:673
HRESULT ExecResourceCmd(int id)
Definition: traywnd.cpp:377
#define IDM_SEARCH
Definition: resource.h:71
#define TRAYCMD_SEARCH_COMPUTERS
Definition: undocshell.h:677
#define TRAYCMD_CUSTOMIZE_TASKBAR
Definition: undocshell.h:668
#define MDITILE_SKIPDISABLED
Definition: winuser.h:2162
#define MDITILE_VERTICAL
Definition: winuser.h:2164
#define TRAYCMD_TASKBAR_PROPERTIES
Definition: undocshell.h:663
VOID ToggleDesktop()
Definition: traywnd.cpp:561
LRESULT DoExitWindows()
Definition: traywnd.cpp:401
static const WCHAR L[]
Definition: oid.c:1250
HWND m_hWnd
Definition: atlwin.h:268
BOOL WINAPI SHFindFiles(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile)
Definition: shellord.c:1827
#define TRAYCMD_TILE_H
Definition: undocshell.h:659
#define TRAYCMD_RUN_DIALOG
Definition: undocshell.h:656
void DisplayRunFileDlg()
Definition: traywnd.cpp:461
VOID MinimizeAll(BOOL bShowDesktop=FALSE)
Definition: traywnd.cpp:2857
#define TRAYCMD_SWITCH_USER_DIALOG
Definition: undocshell.h:675
#define TRAYCMD_STARTMENU
Definition: undocshell.h:655
VOID ShowDesktop()
Definition: traywnd.cpp:2879
WORD WINAPI CascadeWindows(_In_opt_ HWND hwndParent, _In_ UINT wHow, _In_opt_ CONST RECT *lpRect, _In_ UINT cKids, _In_reads_opt_(cKids) const HWND FAR *lpKids)
#define TRAYCMD_LOCK_DESKTOP
Definition: undocshell.h:674
#define TRAYCMD_LOCK_TASKBAR
Definition: undocshell.h:669
#define TRAYCMD_SHUTDOWN_DIALOG
Definition: undocshell.h:672
#define TRAYCMD_LOGOFF_DIALOG
Definition: undocshell.h:657
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2246
EXTERN_C int WINAPI LogoffWindowsDialog(HWND hWndOwner)
Definition: dialogs.cpp:1094
#define TRAYCMD_CONTROL_PANEL
Definition: undocshell.h:671
DWORD WINAPI SHRestricted(RESTRICTIONS policy)
Definition: shpolicy.c:836
#define TRAYCMD_CASCADE
Definition: undocshell.h:658

Referenced by OnCommand().

◆ HandleHotKey()

LRESULT CTrayWindow::HandleHotKey ( DWORD  id)
inline

Definition at line 642 of file traywnd.cpp.

643  {
644  switch (id)
645  {
646  case IDHK_RUN:
648  break;
649  case IDHK_HELP:
651  break;
652  case IDHK_EXPLORE:
653  //FIXME: We don't support this yet:
654  //ShellExecuteW(0, L"explore", NULL, NULL, NULL, 1);
655  ShellExecuteW(0, NULL, L"explorer.exe", L"/e ,", NULL, 1);
656  break;
657  case IDHK_FIND:
659  break;
660  case IDHK_FIND_COMPUTER:
662  break;
663  case IDHK_SYS_PROPERTIES:
664  //FIXME: Use SHRunControlPanel
665  ShellExecuteW(m_hWnd, NULL, L"sysdm.cpl", NULL, NULL, SW_NORMAL);
666  break;
667  case IDHK_NEXT_TASK:
668  break;
669  case IDHK_PREV_TASK:
670  break;
671  case IDHK_MINIMIZE_ALL:
672  MinimizeAll();
673  break;
674  case IDHK_RESTORE_ALL:
675  RestoreAll();
676  break;
677  case IDHK_DESKTOP:
678  ToggleDesktop();
679  break;
680  case IDHK_PAGER:
681  break;
682  }
683 
684  return 0;
685  }
#define IDHK_NEXT_TASK
Definition: traywnd.cpp:51
#define IDHK_PREV_TASK
Definition: traywnd.cpp:52
EXTERN_C BOOL WINAPI SHFindComputer(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: stubs.cpp:33
#define SW_NORMAL
Definition: winuser.h:763
#define IDHK_FIND_COMPUTER
Definition: traywnd.cpp:50
#define IDHK_SYS_PROPERTIES
Definition: traywnd.cpp:53
VOID RestoreAll()
Definition: traywnd.cpp:2884
#define IDHK_DESKTOP
Definition: traywnd.cpp:54
#define IDS_HELP_COMMAND
Definition: resource.h:102
#define IDHK_MINIMIZE_ALL
Definition: traywnd.cpp:45
#define IDHK_RUN
Definition: traywnd.cpp:44
smooth NULL
Definition: ftsmooth.c:416
#define IDHK_HELP
Definition: traywnd.cpp:47
HRESULT ExecResourceCmd(int id)
Definition: traywnd.cpp:377
VOID ToggleDesktop()
Definition: traywnd.cpp:561
static const WCHAR L[]
Definition: oid.c:1250
HWND m_hWnd
Definition: atlwin.h:268
BOOL WINAPI SHFindFiles(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile)
Definition: shellord.c:1827
#define IDHK_EXPLORE
Definition: traywnd.cpp:48
void DisplayRunFileDlg()
Definition: traywnd.cpp:461
VOID MinimizeAll(BOOL bShowDesktop=FALSE)
Definition: traywnd.cpp:2857
#define IDHK_FIND
Definition: traywnd.cpp:49
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2246
#define IDHK_RESTORE_ALL
Definition: traywnd.cpp:46
#define IDHK_PAGER
Definition: traywnd.cpp:55

Referenced by OnHotkey().

◆ if()

CTrayWindow::if ( m_StartMenuBand = NULL)
inline

Definition at line 3074 of file traywnd.cpp.

3075  {
3076  MSG Msg;
3077  LRESULT lRet;
3078 
3079  Msg.hwnd = m_hWnd;
3080  Msg.message = uMsg;
3081  Msg.wParam = wParam;
3082  Msg.lParam = lParam;
3083 
3084  if (m_StartMenuBand->TranslateMenuMessage(&Msg, &lRet) == S_OK)
3085  {
3086  return lRet;
3087  }
3088 
3089  wParam = Msg.wParam;
3090  lParam = Msg.lParam;
3091  }
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
struct @1591 Msg[]
WPARAM wParam
Definition: combotst.c:138
CComPtr< IMenuBand > m_StartMenuBand
Definition: traywnd.cpp:271
HWND m_hWnd
Definition: atlwin.h:268
#define S_OK
Definition: intsafe.h:59
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139

◆ InvokeCommand()

HRESULT STDMETHODCALLTYPE CTrayWindow::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpici)
inline

Implements IContextMenu.

Definition at line 2180 of file traywnd.cpp.

2181  {
2182  if (!m_ContextMenu)
2183  return E_INVALIDARG;
2184 
2185  return m_ContextMenu->InvokeCommand(lpici);
2186  }
CComPtr< IContextMenu > m_ContextMenu
Definition: traywnd.cpp:275
#define E_INVALIDARG
Definition: ddrawi.h:101

◆ IsDialog()

static BOOL CTrayWindow::IsDialog ( HWND  hwnd)
inlinestatic

Definition at line 2825 of file traywnd.cpp.

2826  {
2827  WCHAR szClass[32];
2828  GetClassNameW(hwnd, szClass, _countof(szClass));
2829  return wcscmp(szClass, L"#32770") == 0;
2830  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define _countof(array)
Definition: fontsub.cpp:30
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR L[]
Definition: oid.c:1250
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Referenced by MinimizeWindowsProc().

◆ IsHorizontal()

BOOL STDMETHODCALLTYPE CTrayWindow::IsHorizontal ( )
inline

Definition at line 2105 of file traywnd.cpp.

2106  {
2107  return IsPosHorizontal();
2108  }
BOOL IsPosHorizontal()
Definition: traywnd.cpp:1119

◆ IsPosHorizontal()

BOOL CTrayWindow::IsPosHorizontal ( )
inline

Definition at line 1119 of file traywnd.cpp.

1120  {
1121  return m_Position == ABE_TOP || m_Position == ABE_BOTTOM;
1122  }
#define ABE_TOP
Definition: shellapi.h:18
DWORD m_Position
Definition: traywnd.cpp:287
#define ABE_BOTTOM
Definition: shellapi.h:20

Referenced by AlignControls(), and IsHorizontal().

◆ IsSpecialHWND()

BOOL STDMETHODCALLTYPE CTrayWindow::IsSpecialHWND ( IN HWND  hWnd)
inline

Definition at line 2099 of file traywnd.cpp.

2100  {
2101  return (m_hWnd == hWnd ||
2102  (m_DesktopWnd != NULL && m_hWnd == m_DesktopWnd));
2103  }
HWND hWnd
Definition: settings.c:17
HWND m_DesktopWnd
Definition: traywnd.cpp:280
smooth NULL
Definition: ftsmooth.c:416
HWND m_hWnd
Definition: atlwin.h:268

◆ Lock()

BOOL STDMETHODCALLTYPE CTrayWindow::Lock ( IN BOOL  bLock)
inline

Definition at line 2110 of file traywnd.cpp.

2111  {
2112  BOOL bPrevLock = g_TaskbarSettings.bLock;
2113 
2114  if (g_TaskbarSettings.bLock != bLock)
2115  {
2116  g_TaskbarSettings.bLock = bLock;
2117 
2118  if (m_TrayBandSite != NULL)
2119  {
2120  if (!SUCCEEDED(m_TrayBandSite->Lock(bLock)))
2121  {
2122  /* Reset?? */
2123  g_TaskbarSettings.bLock = bPrevLock;
2124  return bPrevLock;
2125  }
2126  }
2127 
2128  if (m_Theme)
2129  {
2130  /* Update cached tray sizes */
2131  for(DWORD Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++)
2132  {
2133  RECT rcGripper = {0};
2134  AdjustSizerRect(&rcGripper, Pos);
2135 
2137  {
2138  m_TrayRects[Pos].top += rcGripper.top;
2139  m_TrayRects[Pos].left += rcGripper.left;
2140  m_TrayRects[Pos].bottom += rcGripper.bottom;
2141  m_TrayRects[Pos].right += rcGripper.right;
2142  }
2143  else
2144  {
2145  m_TrayRects[Pos].top -= rcGripper.top;
2146  m_TrayRects[Pos].left -= rcGripper.left;
2147  m_TrayRects[Pos].bottom -= rcGripper.bottom;
2148  m_TrayRects[Pos].right -= rcGripper.right;
2149  }
2150  }
2151  }
2153  ResizeWorkArea();
2155  }
2156 
2157  return bPrevLock;
2158  }
#define TRUE
Definition: types.h:120
ush Pos
Definition: deflate.h:92
BOOL SetWindowPos(HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
Definition: atlwin.h:1220
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
CComPtr< ITrayBandSite > m_TrayBandSite
Definition: traywnd.cpp:306
#define SWP_NOZORDER
Definition: winuser.h:1232
LONG right
Definition: windef.h:293
#define ABE_LEFT
Definition: shellapi.h:17
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
RECT m_TrayRects[4]
Definition: traywnd.cpp:293
HTHEME m_Theme
Definition: traywnd.cpp:276
#define SWP_NOACTIVATE
Definition: winuser.h:1227
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SWP_FRAMECHANGED
Definition: winuser.h:1225
VOID ApplyClipping(IN BOOL Clip)
Definition: traywnd.cpp:1393
#define ABE_BOTTOM
Definition: shellapi.h:20
VOID AdjustSizerRect(RECT *rc, DWORD pos)
Definition: traywnd.cpp:1044
VOID ResizeWorkArea()
Definition: traywnd.cpp:1430
LONG bottom
Definition: windef.h:294
#define SWP_NOMOVE
Definition: winuser.h:1229
#define SUCCEEDED(hr)
Definition: intsafe.h:57
#define SWP_NOOWNERZORDER
Definition: winuser.h:1234

◆ MakeTrayRectWithSize()

VOID CTrayWindow::MakeTrayRectWithSize ( IN DWORD  Position,
IN const SIZE pTraySize,
IN OUT RECT pRect 
)
inline

Definition at line 1073 of file traywnd.cpp.

1076  {
1077  switch (Position)
1078  {
1079  case ABE_LEFT:
1080  pRect->right = pRect->left + pTraySize->cx;
1081  break;
1082 
1083  case ABE_TOP:
1084  pRect->bottom = pRect->top + pTraySize->cy;
1085  break;
1086 
1087  case ABE_RIGHT:
1088  pRect->left = pRect->right - pTraySize->cx;
1089  break;
1090 
1091  case ABE_BOTTOM:
1092  default:
1093  pRect->top = pRect->bottom - pTraySize->cy;
1094  break;
1095  }
1096  }
#define ABE_TOP
Definition: shellapi.h:18
static COORD Position
Definition: mouse.c:34
#define ABE_LEFT
Definition: shellapi.h:17
#define ABE_RIGHT
Definition: shellapi.h:19
#define ABE_BOTTOM
Definition: shellapi.h:20

Referenced by ChangingWinPos(), and GetTrayRectFromScreenRect().

◆ MinimizeAll()

VOID CTrayWindow::MinimizeAll ( BOOL  bShowDesktop = FALSE)
inline

Definition at line 2857 of file traywnd.cpp.

2858  {
2859  MINIMIZE_INFO info;
2860  info.hwndDesktop = GetDesktopWindow();;
2861  info.hTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL);
2862  info.hwndProgman = FindWindowW(L"Progman", NULL);
2863  info.bRet = FALSE;
2864  info.pMinimizedAll = &g_MinimizedAll;
2865  info.bShowDesktop = bShowDesktop;
2867 
2868  // invalid handles should be cleared to avoid mismatch of handles
2869  for (INT i = 0; i < g_MinimizedAll.GetSize(); ++i)
2870  {
2871  if (!::IsWindow(g_MinimizedAll[i]))
2872  g_MinimizedAll[i] = NULL;
2873  }
2874 
2877  }
HWND SetFocus()
Definition: atlwin.h:1130
BOOL IsWindow() const
Definition: atlwin.h:879
int32_t INT
Definition: typedefs.h:56
struct _test_info info[]
Definition: SetCursorPos.c:19
HWND m_DesktopWnd
Definition: traywnd.cpp:280
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
static BOOL CALLBACK MinimizeWindowsProc(HWND hwnd, LPARAM lParam)
Definition: traywnd.cpp:2832
CSimpleArray< HWND > g_MinimizedAll
Definition: traywnd.cpp:129
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:652
LONG_PTR LPARAM
Definition: windef.h:208
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC, _In_ LPARAM)
static const WCHAR L[]
Definition: oid.c:1250
BOOL WINAPI SetForegroundWindow(_In_ HWND)

Referenced by HandleCommand(), HandleHotKey(), and ShowDesktop().

◆ MinimizeWindowsProc()

static BOOL CALLBACK CTrayWindow::MinimizeWindowsProc ( HWND  hwnd,
LPARAM  lParam 
)
inlinestatic

Definition at line 2832 of file traywnd.cpp.

2833  {
2834  MINIMIZE_INFO *info = (MINIMIZE_INFO *)lParam;
2835  if (hwnd == info->hwndDesktop || hwnd == info->hTrayWnd ||
2836  hwnd == info->hwndProgman)
2837  {
2838  return TRUE;
2839  }
2840  if (!info->bShowDesktop)
2841  {
2842  if (!::IsWindowEnabled(hwnd) || IsDialog(hwnd))
2843  return TRUE;
2844  HWND hwndOwner = ::GetWindow(hwnd, GW_OWNER);
2845  if (hwndOwner && !::IsWindowEnabled(hwndOwner))
2846  return TRUE;
2847  }
2848  if (::IsWindowVisible(hwnd) && !::IsIconic(hwnd))
2849  {
2851  info->bRet = TRUE;
2852  info->pMinimizedAll->Add(hwnd);
2853  }
2854  return TRUE;
2855  }
BOOL IsWindowEnabled() const
Definition: atlwin.h:884
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
BOOL ShowWindowAsync(int nCmdShow)
Definition: atlwin.h:1271
#define SW_MINIMIZE
Definition: winuser.h:770
BOOL IsIconic() const
Definition: atlwin.h:864
#define GW_OWNER
Definition: winuser.h:761
HRESULT WINAPI GetWindow(HWND *phwnd)
Definition: traywnd.cpp:3221
static BOOL IsDialog(HWND hwnd)
Definition: traywnd.cpp:2825
LPARAM lParam
Definition: combotst.c:139
BOOL IsWindowVisible() const
Definition: atlwin.h:890

Referenced by MinimizeAll().

◆ NOTIFY_CODE_HANDLER()

CTrayWindow::NOTIFY_CODE_HANDLER ( RBN_AUTOSIZE  ,
OnRebarAutoSize   
)
inline

Definition at line 3094 of file traywnd.cpp.

3135  {
3136  MSG Msg;
3137 
3138  /* FIXME: We should keep a reference here... */
3139 
3140  while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
3141  {
3142  if (Msg.message == WM_QUIT)
3143  break;
3144 
3145  if (m_StartMenuBand == NULL ||
3146  m_StartMenuBand->IsMenuMessage(&Msg) != S_OK)
3147  {
3149  DispatchMessage(&Msg);
3150  }
3151  }
3152  }
#define DispatchMessage
Definition: winuser.h:5666
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define PeekMessage
Definition: winuser.h:5731
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
struct @1591 Msg[]
#define WM_QUIT
Definition: winuser.h:1605
smooth NULL
Definition: ftsmooth.c:416
CComPtr< IMenuBand > m_StartMenuBand
Definition: traywnd.cpp:271
#define S_OK
Definition: intsafe.h:59
#define PM_REMOVE
Definition: winuser.h:1182

◆ OnAppTrayDestroy()

LRESULT CTrayWindow::OnAppTrayDestroy ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2758 of file traywnd.cpp.

2759  {
2760  DestroyWindow();
2761  return TRUE;
2762  }
#define TRUE
Definition: types.h:120
BOOL DestroyWindow()
Definition: atlwin.h:428

◆ OnCommand()

LRESULT CTrayWindow::OnCommand ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2897 of file traywnd.cpp.

2898  {
2899  LRESULT Ret = FALSE;
2900 
2901  if ((HWND) lParam == m_StartButton.m_hWnd)
2902  {
2903  return FALSE;
2904  }
2905 
2906  if (m_TrayBandSite == NULL || FAILED_UNEXPECTEDLY(m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret)))
2907  {
2908  return HandleCommand(LOWORD(wParam));
2909  }
2910  return Ret;
2911  }
LRESULT HandleCommand(UINT uCommand)
Definition: traywnd.cpp:687
CComPtr< ITrayBandSite > m_TrayBandSite
Definition: traywnd.cpp:306
WPARAM wParam
Definition: combotst.c:138
smooth NULL
Definition: ftsmooth.c:416
CStartButton m_StartButton
Definition: traywnd.cpp:269
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
HWND m_hWnd
Definition: atlwin.h:268
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

◆ OnContextMenu()

LRESULT CTrayWindow::OnContextMenu ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2646 of file traywnd.cpp.

2647  {
2648  LRESULT Ret = FALSE;
2649  POINT pt, *ppt = NULL;
2650  HWND hWndExclude = NULL;
2651 
2652  /* Check if the administrator has forbidden access to context menus */
2654  return FALSE;
2655 
2656  pt.x = (SHORT) LOWORD(lParam);
2657  pt.y = (SHORT) HIWORD(lParam);
2658 
2659  if (pt.x != -1 || pt.y != -1)
2660  ppt = &pt;
2661  else
2662  hWndExclude = m_StartButton.m_hWnd;
2663 
2664  if ((HWND) wParam == m_StartButton.m_hWnd)
2665  {
2666  /* Make sure we can't track the context menu if the start
2667  menu is currently being shown */
2669  {
2670  CComPtr<IContextMenu> ctxMenu;
2672  TrackCtxMenu(ctxMenu, ppt, hWndExclude, m_Position == ABE_BOTTOM, this);
2673  }
2674  }
2675  else
2676  {
2677  /* See if the context menu should be handled by the task band site */
2678  if (ppt != NULL && m_TrayBandSite != NULL)
2679  {
2680  HWND hWndAtPt;
2681  POINT ptClient = *ppt;
2682 
2683  /* Convert the coordinates to client-coordinates */
2684  ::MapWindowPoints(NULL, m_hWnd, &ptClient, 1);
2685 
2686  hWndAtPt = ChildWindowFromPoint(ptClient);
2687  if (hWndAtPt != NULL &&
2688  (hWndAtPt == m_Rebar || ::IsChild(m_Rebar, hWndAtPt)))
2689  {
2690  /* Check if the user clicked on the task switch window */
2691  ptClient = *ppt;
2692  ::MapWindowPoints(NULL, m_Rebar, &ptClient, 1);
2693 
2695  if (hWndAtPt == m_TaskSwitch)
2696  goto HandleTrayContextMenu;
2697 
2698  /* Forward the message to the task band site */
2699  m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret);
2700  }
2701  else
2702  goto HandleTrayContextMenu;
2703  }
2704  else
2705  {
2706 HandleTrayContextMenu:
2707  /* Tray the default tray window context menu */
2708  TrackCtxMenu(this, ppt, NULL, FALSE, this);
2709  }
2710  }
2711  return Ret;
2712  }
int MapWindowPoints(HWND hWndTo, LPPOINT lpPoint, UINT nCount) const
Definition: atlwin.h:922
#define pt(x, y)
Definition: drawing.c:79
#define BM_GETSTATE
Definition: winuser.h:1902
CComPtr< ITrayBandSite > m_TrayBandSite
Definition: traywnd.cpp:306
DWORD m_Position
Definition: traywnd.cpp:287
WPARAM wParam
Definition: combotst.c:138
HRESULT CStartMenuBtnCtxMenu_CreateInstance(ITrayWindow *TrayWnd, IN HWND hWndOwner, IContextMenu **ppCtxMenu)
HWND m_Rebar
Definition: traywnd.cpp:281
BOOL IsChild(const HWND hWnd) const
Definition: atlwin.h:846
short SHORT
Definition: pedump.c:59
#define CWP_SKIPINVISIBLE
Definition: winuser.h:208
#define CWP_SKIPDISABLED
Definition: winuser.h:209
smooth NULL
Definition: ftsmooth.c:416
CStartButton m_StartButton
Definition: traywnd.cpp:269
#define BST_PUSHED
Definition: winuser.h:201
HWND m_hWnd
Definition: atlwin.h:268
#define ABE_BOTTOM
Definition: shellapi.h:20
HWND ChildWindowFromPoint(POINT point) const
Definition: atlwin.h:347
HWND m_TaskSwitch
Definition: traywnd.cpp:282
#define HIWORD(l)
Definition: typedefs.h:246
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
HWND ChildWindowFromPointEx(POINT point, UINT uFlags) const
Definition: atlwin.h:353
LONG_PTR LRESULT
Definition: windef.h:209
DWORD WINAPI SHRestricted(RESTRICTIONS policy)
Definition: shpolicy.c:836
HRESULT TrackCtxMenu(IN IContextMenu *contextMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN PVOID Context OPTIONAL)
Definition: traywnd.cpp:843
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by OnNcRButtonUp().

◆ OnCopyData()

LRESULT CTrayWindow::OnCopyData ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2342 of file traywnd.cpp.

2343  {
2344  if (m_TrayNotify)
2346  return TRUE;
2347  }
#define TRUE
Definition: types.h:120
WPARAM wParam
Definition: combotst.c:138
HWND m_TrayNotify
Definition: traywnd.cpp:283
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPARAM lParam
Definition: combotst.c:139

◆ OnCreate()

LRESULT CTrayWindow::OnCreate ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2205 of file traywnd.cpp.

2206  {
2207  HRESULT hRet;
2208 
2209  ((ITrayWindow*)this)->AddRef();
2210 
2211  SetWindowTheme(m_hWnd, L"TaskBar", NULL);
2212 
2213  /* Create the Start button */
2215 
2216  /* Load the saved tray window settings */
2217  RegLoadSettings();
2218 
2219  /* Create and initialize the start menu */
2221  m_StartMenuPopup = CreateStartMenu(this, &m_StartMenuBand, hbmBanner, 0);
2222 
2223  /* Create the task band */
2225  if (FAILED_UNEXPECTEDLY(hRet))
2226  return FALSE;
2227 
2228  /* Create the rebar band site. This actually creates the rebar and the tasks toolbar. */
2230  if (FAILED_UNEXPECTEDLY(hRet))
2231  return FALSE;
2232 
2233  /* Create the tray notification window */
2235  if (FAILED_UNEXPECTEDLY(hRet))
2236  return FALSE;
2237 
2238  /* Get the hwnd of the rebar */
2240  if (FAILED_UNEXPECTEDLY(hRet))
2241  return FALSE;
2242 
2243  /* Get the hwnd of the tasks toolbar */
2245  if (FAILED_UNEXPECTEDLY(hRet))
2246  return FALSE;
2247 
2248  /* Get the hwnd of the tray notification window */
2250  if (FAILED_UNEXPECTEDLY(hRet))
2251  return FALSE;
2252 
2253  SetWindowTheme(m_Rebar, L"TaskBar", NULL);
2254 
2255  UpdateFonts();
2256 
2258 
2260  {
2263  }
2264 
2265  /* Set the initial lock state in the band site */
2267 
2280 
2281  return TRUE;
2282  }
#define IDHK_NEXT_TASK
Definition: traywnd.cpp:51
#define IDHK_PREV_TASK
Definition: traywnd.cpp:52
#define TRUE
Definition: types.h:120
#define IDHK_FIND_COMPUTER
Definition: traywnd.cpp:50
#define IDHK_SYS_PROPERTIES
Definition: traywnd.cpp:53
#define TIMER_ID_AUTOHIDE
Definition: traywnd.cpp:29
IMenuPopup * CreateStartMenu(IN ITrayWindow *Tray, OUT IMenuBand **ppMenuBand, IN HBITMAP hbmBanner OPTIONAL, IN BOOL bSmallIcons)
Definition: startmnu.cpp:44
#define IDHK_DESKTOP
Definition: traywnd.cpp:54
#define VK_TAB
Definition: winuser.h:2174
#define IDHK_MINIMIZE_ALL
Definition: traywnd.cpp:45
#define AUTOHIDE_DELAY_HIDE
Definition: traywnd.cpp:32
CComPtr< ITrayBandSite > m_TrayBandSite
Definition: traywnd.cpp:306
#define IID_PPV_ARG(Itype, ppType)
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1283
#define IDHK_RUN
Definition: traywnd.cpp:44
TW_STRUCKRECTS2 sr
Definition: precomp.h:209
HWND m_Rebar
Definition: traywnd.cpp:281
HWND m_TrayNotify
Definition: traywnd.cpp:283
HRESULT CTrayNotifyWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
Definition: trayntfy.cpp:372
HWND Create(HWND hwndParent)
Definition: traywnd.cpp:215
UINT_PTR SetTimer(UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL)
Definition: atlwin.h:1190
void UpdateFonts()
Definition: traywnd.cpp:923
DWORD AutoHide
Definition: precomp.h:192
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
CComPtr< IDeskBand > m_TaskBand
Definition: traywnd.cpp:274
smooth NULL
Definition: ftsmooth.c:416
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
#define IDHK_HELP
Definition: traywnd.cpp:47
CStartButton m_StartButton
Definition: traywnd.cpp:269
UINT m_AutoHideState
Definition: traywnd.cpp:299
CComPtr< IMenuBand > m_StartMenuBand
Definition: traywnd.cpp:271
LONG HRESULT
Definition: typedefs.h:77
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
HRESULT CTrayBandSite_CreateInstance(IN ITrayWindow *tray, IN IDeskBand *pTaskBand, OUT ITrayBandSite **pBandSite)
Definition: tbsite.cpp:715
HDPA m_ShellServices
Definition: traywnd.cpp:303
VOID RegLoadSettings()
Definition: traywnd.cpp:1503
static const WCHAR L[]
Definition: oid.c:1250
HRESULT InitShellServices(HDPA *phdpa)
HWND m_hWnd
Definition: atlwin.h:268
CComPtr< IMenuPopup > m_StartMenuPopup
Definition: traywnd.cpp:272
#define AUTOHIDE_HIDING
Definition: traywnd.cpp:42
#define IDHK_EXPLORE
Definition: traywnd.cpp:48
#define MOD_CONTROL
Definition: imm.h:312
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2132
#define MOD_SHIFT
Definition: imm.h:313
HWND m_TaskSwitch
Definition: traywnd.cpp:282
#define IDHK_FIND
Definition: traywnd.cpp:49
#define IDB_STARTMENU
Definition: resource.h:44
#define VK_F1
Definition: winuser.h:2230
CComPtr< IUnknown > m_TrayNotifyInstance
Definition: traywnd.cpp:285
#define VK_PAUSE
Definition: winuser.h:2180
#define IDHK_RESTORE_ALL
Definition: traywnd.cpp:46
#define MOD_WIN
Definition: winuser.h:2619
static HBITMAP
Definition: button.c:44
BOOL WINAPI RegisterHotKey(_In_opt_ HWND, _In_ int, _In_ UINT, _In_ UINT)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HRESULT CTaskBand_CreateInstance(IN ITrayWindow *Tray, HWND hWndStartButton, REFIID riid, void **ppv)
Definition: taskband.cpp:346
#define IDHK_PAGER
Definition: traywnd.cpp:55

◆ OnCtlColorBtn()

LRESULT CTrayWindow::OnCtlColorBtn ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2364 of file traywnd.cpp.

2365  {
2368  }
HGDIOBJ WINAPI GetStockObject(_In_ int)
static HDC
Definition: imagelist.c:92
WPARAM wParam
Definition: combotst.c:138
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1032
#define TRANSPARENT
Definition: wingdi.h:949
#define HOLLOW_BRUSH
Definition: wingdi.h:898
LONG_PTR LRESULT
Definition: windef.h:209

◆ OnDisplayChange()

LRESULT CTrayWindow::OnDisplayChange ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2331 of file traywnd.cpp.

2332  {
2333  /* Load the saved tray window settings */
2334  RegLoadSettings();
2335 
2336  /* Move the tray window to the right position and resize it if necessary */
2338 
2339  return TRUE;
2340  }
#define TRUE
Definition: types.h:120
VOID CheckTrayWndPosition()
Definition: traywnd.cpp:1482
VOID RegLoadSettings()
Definition: traywnd.cpp:1503

◆ OnDoExitWindows()

LRESULT CTrayWindow::OnDoExitWindows ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2783 of file traywnd.cpp.

2784  {
2785  /*
2786  * TWM_DOEXITWINDOWS is send by the CDesktopBrowser to us
2787  * to show the shutdown dialog. Also a WM_CLOSE message sent
2788  * by apps should show the dialog.
2789  */
2790  return DoExitWindows();
2791  }
LRESULT DoExitWindows()
Definition: traywnd.cpp:401

◆ OnEnterSizeMove()

LRESULT CTrayWindow::OnEnterSizeMove ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2491 of file traywnd.cpp.

2492  {
2493  InSizeMove = TRUE;
2494  IsDragging = FALSE;
2495  if (!g_TaskbarSettings.bLock)
2496  {
2497  /* Remove the clipping on multi monitor systems while dragging around */
2499  }
2500  return TRUE;
2501  }
#define TRUE
Definition: types.h:120
DWORD IsDragging
Definition: traywnd.cpp:315
DWORD InSizeMove
Definition: traywnd.cpp:314
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
VOID ApplyClipping(IN BOOL Clip)
Definition: traywnd.cpp:1393

◆ OnEraseBackground()

LRESULT CTrayWindow::OnEraseBackground ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2318 of file traywnd.cpp.

2319  {
2320  HDC hdc = (HDC) wParam;
2321 
2322  if (!m_Theme)
2323  {
2324  bHandled = FALSE;
2325  return 0;
2326  }
2327 
2328  return EraseBackgroundWithTheme(hdc);
2329  }
static HDC
Definition: imagelist.c:92
WPARAM wParam
Definition: combotst.c:138
LRESULT EraseBackgroundWithTheme(HDC hdc)
Definition: traywnd.cpp:1980
HTHEME m_Theme
Definition: traywnd.cpp:276
HDC hdc
Definition: main.c:9

◆ OnExitSizeMove()

LRESULT CTrayWindow::OnExitSizeMove ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2503 of file traywnd.cpp.

2504  {
2505  InSizeMove = FALSE;
2506  if (!g_TaskbarSettings.bLock)
2507  {
2509 
2510  /* Apply clipping */
2512  }
2513  return TRUE;
2514  }
#define TRUE
Definition: types.h:120
void FitToRebar(PRECT pRect)
Definition: traywnd.cpp:1726
#define SIZE_RESTORED
Definition: winuser.h:2480
DWORD m_Position
Definition: traywnd.cpp:287
DWORD InSizeMove
Definition: traywnd.cpp:314
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
RECT m_TrayRects[4]
Definition: traywnd.cpp:293
#define WM_SIZE
Definition: winuser.h:1593
BOOL PostMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:976

◆ OnGetTaskSwitch()

LRESULT CTrayWindow::OnGetTaskSwitch ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2804 of file traywnd.cpp.

2805  {
2806  bHandled = TRUE;
2807  return (LRESULT)m_TaskSwitch;
2808  }
#define TRUE
Definition: types.h:120
HWND m_TaskSwitch
Definition: traywnd.cpp:282
LONG_PTR LRESULT
Definition: windef.h:209

◆ OnHotkey()

LRESULT CTrayWindow::OnHotkey ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2810 of file traywnd.cpp.

2811  {
2812  return HandleHotKey(wParam);
2813  }
LRESULT HandleHotKey(DWORD id)
Definition: traywnd.cpp:642
WPARAM wParam
Definition: combotst.c:138

◆ OnInitMenuPopup()

LRESULT CTrayWindow::OnInitMenuPopup ( INT  code,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2967 of file traywnd.cpp.

2968  {
2969  HMENU hMenu = (HMENU)wParam;
2971  {
2975  }
2976  else
2977  {
2981  }
2982  return 0;
2983  }
#define MF_BYCOMMAND
Definition: winuser.h:202
static BOOL IsThereAnyEffectiveWindow(BOOL bMustBeInMonitor)
Definition: traywnd.cpp:109
#define ID_SHELL_CMD_CASCADE_WND
Definition: resource.h:194
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_ENABLED
Definition: winuser.h:128
#define ID_SHELL_CMD_TILE_WND_H
Definition: resource.h:193
#define MF_GRAYED
Definition: winuser.h:129
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define ID_SHELL_CMD_TILE_WND_V
Definition: resource.h:192

◆ OnMouseMove()

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

Definition at line 2913 of file traywnd.cpp.

2914  {
2916  {
2918  }
2919 
2920  return TRUE;
2921  }
#define TRUE
Definition: types.h:120
TW_STRUCKRECTS2 sr
Definition: precomp.h:209
UINT_PTR SetTimer(UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL)
Definition: atlwin.h:1190
#define MOUSETRACK_INTERVAL
Definition: traywnd.cpp:31
DWORD AutoHide
Definition: precomp.h:192
smooth NULL
Definition: ftsmooth.c:416
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
#define TIMER_ID_MOUSETRACK
Definition: traywnd.cpp:30

◆ OnMoving()

LRESULT CTrayWindow::OnMoving ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2422 of file traywnd.cpp.

2423  {
2424  POINT ptCursor;
2425  PRECT pRect = (PRECT) lParam;
2426 
2427  /* We need to ensure that an application can not accidently
2428  move the tray window (using SetWindowPos). However, we still
2429  need to be able to move the window in case the user wants to
2430  drag the tray window to another position or in case the user
2431  wants to resize the tray window. */
2432  if (!g_TaskbarSettings.bLock && GetCursorPos(&ptCursor))
2433  {
2434  IsDragging = TRUE;
2436  }
2437  else
2438  {
2439  *pRect = m_TrayRects[m_Position];
2440  }
2441  return TRUE;
2442  }
#define TRUE
Definition: types.h:120
DWORD IsDragging
Definition: traywnd.cpp:315
DWORD GetDraggingRectFromPt(IN POINT pt, OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1181
DWORD m_Position
Definition: traywnd.cpp:287
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
RECT m_TrayRects[4]
Definition: traywnd.cpp:293
DWORD m_DraggingPosition
Definition: traywnd.cpp:290
HMONITOR m_DraggingMonitor
Definition: traywnd.cpp:291
struct tagRECT * PRECT
LPARAM lParam
Definition: combotst.c:139

◆ OnNcCalcSize()

LRESULT CTrayWindow::OnNcCalcSize ( INT  code,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2938 of file traywnd.cpp.

2939  {
2940  RECT *rc = NULL;
2941  /* Ignore WM_NCCALCSIZE if we are not themed or locked */
2943  {
2944  bHandled = FALSE;
2945  return 0;
2946  }
2947  if(!wParam)
2948  {
2949  rc = (RECT*)wParam;
2950  }
2951  else
2952  {
2954  if(prms->lppos->flags & SWP_NOSENDCHANGING)
2955  {
2956  bHandled = FALSE;
2957  return 0;
2958  }
2959  rc = &prms->rgrc[0];
2960  }
2961 
2963 
2964  return 0;
2965  }
DWORD m_Position
Definition: traywnd.cpp:287
#define SWP_NOSENDCHANGING
Definition: winuser.h:1236
WPARAM wParam
Definition: combotst.c:138
smooth NULL
Definition: ftsmooth.c:416
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
PWINDOWPOS lppos
Definition: winuser.h:3573
UINT flags
Definition: winuser.h:3568
HTHEME m_Theme
Definition: traywnd.cpp:276
VOID AdjustSizerRect(RECT *rc, DWORD pos)
Definition: traywnd.cpp:1044
LPARAM lParam
Definition: combotst.c:139

◆ OnNcHitTest()

LRESULT CTrayWindow::OnNcHitTest ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2370 of file traywnd.cpp.

2371  {
2372  RECT rcClient;
2373  POINT pt;
2374 
2376  {
2377  /* The user may not be able to resize the tray window.
2378  Pretend like the window is not sizeable when the user
2379  clicks on the border. */
2380  return HTBORDER;
2381  }
2382 
2384  if (GetClientRect(&rcClient) &&
2385  (MapWindowPoints(NULL, (LPPOINT) &rcClient, 2) != 0 || GetLastError() == ERROR_SUCCESS))
2386  {
2387  pt.x = (SHORT) LOWORD(lParam);
2388  pt.y = (SHORT) HIWORD(lParam);
2389 
2390  if (PtInRect(&rcClient, pt))
2391  {
2392  /* The user is trying to drag the tray window */
2393  return HTCAPTION;
2394  }
2395 
2396  /* Depending on the position of the tray window, allow only
2397  changing the border next to the monitor working area */
2398  switch (m_Position)
2399  {
2400  case ABE_TOP:
2401  if (pt.y > rcClient.bottom)
2402  return HTBOTTOM;
2403  break;
2404  case ABE_LEFT:
2405  if (pt.x > rcClient.right)
2406  return HTRIGHT;
2407  break;
2408  case ABE_RIGHT:
2409  if (pt.x < rcClient.left)
2410  return HTLEFT;
2411  break;
2412  case ABE_BOTTOM:
2413  default:
2414  if (pt.y < rcClient.top)
2415  return HTTOP;
2416  break;
2417  }
2418  }
2419  return HTBORDER;
2420  }
#define HTTOP
Definition: winuser.h:2465
#define HTLEFT
Definition: winuser.h:2462
int MapWindowPoints(HWND hWndTo, LPPOINT lpPoint, UINT nCount) const
Definition: atlwin.h:922
#define ABE_TOP
Definition: shellapi.h:18
#define ERROR_SUCCESS
Definition: deptool.c:10
#define pt(x, y)
Definition: drawing.c:79
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define HTRIGHT
Definition: winuser.h:2464
DWORD m_Position
Definition: traywnd.cpp:287
#define ABE_LEFT
Definition: shellapi.h:17
short SHORT
Definition: pedump.c:59
BOOL GetClientRect(LPRECT lpRect) const
Definition: atlwin.h:507
smooth NULL
Definition: ftsmooth.c:416
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
#define ABE_RIGHT
Definition: shellapi.h:19
#define HTBOTTOM
Definition: winuser.h:2468
#define SetLastError(x)
Definition: compat.h:417
#define HTCAPTION
Definition: winuser.h:2451
#define ABE_BOTTOM
Definition: shellapi.h:20
#define HTBORDER
Definition: winuser.h:2472
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define HIWORD(l)
Definition: typedefs.h:246
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

◆ OnNcLButtonDblClick()

LRESULT CTrayWindow::OnNcLButtonDblClick ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2748 of file traywnd.cpp.

2749  {
2750  /* Let the clock handle the double click */
2752 
2753  /* We "handle" this message so users can't cause a weird maximize/restore
2754  window animation when double-clicking the tray window! */
2755  return TRUE;
2756  }
#define TRUE
Definition: types.h:120
WPARAM wParam
Definition: combotst.c:138
HWND m_TrayNotify
Definition: traywnd.cpp:283
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPARAM lParam
Definition: combotst.c:139

◆ OnNcLButtonDown()

LRESULT CTrayWindow::OnNcLButtonDown ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2579 of file traywnd.cpp.

2580  {
2581  /* This handler implements the trick that makes the start button to
2582  get pressed when the user clicked left or below the button */
2583 
2585  WINDOWINFO wi = {sizeof(WINDOWINFO)};
2586  RECT rcStartBtn;
2587 
2588  bHandled = FALSE;
2589 
2590  m_StartButton.GetWindowRect(&rcStartBtn);
2591  GetWindowInfo(m_hWnd, &wi);
2592 
2593  switch (m_Position)
2594  {
2595  case ABE_TOP:
2596  case ABE_LEFT:
2597  {
2598  if (pt.x > rcStartBtn.right || pt.y > rcStartBtn.bottom)
2599  return 0;
2600  break;
2601  }
2602  case ABE_RIGHT:
2603  {
2604  if (pt.x < rcStartBtn.left || pt.y > rcStartBtn.bottom)
2605  return 0;
2606 
2607  if (rcStartBtn.right + (int)wi.cxWindowBorders * 2 + 1 < wi.rcWindow.right &&
2608  pt.x > rcStartBtn.right)
2609  {
2610  return 0;
2611  }
2612  break;
2613  }
2614  case ABE_BOTTOM:
2615  {
2616  if (pt.x > rcStartBtn.right || pt.y < rcStartBtn.top)
2617  {
2618  return 0;
2619  }
2620 
2621  if (rcStartBtn.bottom + (int)wi.cyWindowBorders * 2 + 1 < wi.rcWindow.bottom &&
2622  pt.y > rcStartBtn.bottom)
2623  {
2624  return 0;
2625  }
2626 
2627  break;
2628  }
2629  }
2630 
2631  bHandled = TRUE;
2632  PopupStartMenu();
2633  return 0;
2634  }
#define ABE_TOP
Definition: shellapi