ReactOS 0.4.17-dev-966-gf06eace
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)
 
void SaveState ()
 
void RefreshStartMenuSettings ()
 
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)
 
VOID HideStartMenu ()
 
VOID ShowFolder (INT csidl, BOOL bExplore)
 
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)
 
BOOL STDMETHODCALLTYPE IsTaskWnd (HWND hWnd)
 
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 OnDestroy (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnEndSession (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)
 
void DrawShowDesktopButton ()
 
LRESULT OnNcPaint (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCtlColorBtn (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSysColorChange (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)
 
BOOL IsPointWithinStartButton (LPPOINT ppt, LPRECT prcStartBtn, PWINDOWINFO pwi)
 
BOOL IsPointWithinShowDesktopButton (LPPOINT ppt, LPRECT prcShowDesktopBtn, PWINDOWINFO pwi)
 
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 OnNcLButtonUp (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnLButtonUp (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 OnSetZOrder (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
STDMETHODIMP NotifyFullScreenToAppBars (HMONITOR hMonitor, BOOL bFullOpening) override
 
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 OnNcActivate (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 OnActivate (INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSetFocus (INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnGetMinMaxInfo (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)
 
LRESULT OnWinMMDeviceChange (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
VOID TrayProcessMessages ()
 
VOID TrayMessageLoop ()
 
 GetState () override
 
STDMETHODIMP GetTrayWindow (OUT HWND *phWndTray) override
 
STDMETHODIMP RegisterDesktopWindow (IN HWND hWndDesktop) override
 
STDMETHODIMP Unknown (IN DWORD dwUnknown1, IN DWORD dwUnknown2) override
 
virtual HRESULT RaiseStartButton ()
 
STDMETHODIMP GetWindow (HWND *phwnd) override
 
STDMETHODIMP ContextSensitiveHelp (BOOL fEnterMode) override
 
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< TBase, TWinTraits >
 CWindowImplBaseT ()
 
virtual void OnFinalMessage (HWND)
 
BOOL SubclassWindow (HWND hWnd)
 
HWND UnsubclassWindow (BOOL bForce=FALSE)
 
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< TBase >
 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 (_In_ int nID) const
 
UINT GetDlgItemInt (_In_ int nID, _Out_opt_ BOOL *lpTrans=NULL, _In_ BOOL bSigned=TRUE) const
 
UINT GetDlgItemText (_In_ int nID, _Out_writes_to_(nMaxCount, return+1) LPTSTR lpStr, _In_ int nMaxCount) const
 
BOOL GetDlgItemText (_In_ int nID, _Inout_ _Outref_result_maybenull_ _Post_z_ 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 (_Out_writes_to_(nMaxCount, return+1) LPTSTR lpszStringBuf, _In_ int nMaxCount) const
 
BOOL GetWindowText (_Inout_ _Outref_result_maybenull_ _Post_z_ BSTR &bstrText) const
 
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 CAppBarManager
 CAppBarManager ()
 
virtual ~CAppBarManager ()
 
LRESULT OnAppBarMessage (_Inout_ PCOPYDATASTRUCT pCopyData)
 
HRESULT GetWindow ([out] HWND *phwnd)
 
HRESULT ContextSensitiveHelp ([in] BOOL fEnterMode)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
HRESULT QueryContextMenu ([in] HMENU hmenu, [in] UINT indexMenu, [in] UINT idCmdFirst, [in] UINT idCmdLast, [in] UINT uFlags)
 
HRESULT InvokeCommand ([in] LPCMINVOKECOMMANDINFO lpici)
 
HRESULT GetCommandString ([in] UINT_PTR idCmd, [in] UINT uType, [out] UINT *pwReserved, [out, size_is(cchMax)] LPSTR pszName, [in] UINT cchMax)
 

Static Public Member Functions

static DWORD WINAPI s_RunFileDlgThread (IN OUT PVOID pParam)
 
static DWORD WINAPI s_TrayPropertiesThread (IN OUT PVOID pParam)
 
static DWORD CALLBACK EjectThreadProc (LPVOID arg)
 
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_ENTRY * GetCategoryMap ()
 
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< TBase, TWinTraits >
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< TBase, TWinTraits >
WNDPROC m_pfnSuperWindowProc
 
- Public Attributes inherited from ATL::CWindowImplRoot< TBase >
CWndProcThunk m_thunk
 
const _ATL_MSG * m_pCurrentMsg
 
DWORD m_dwState
 
- Public Attributes inherited from ATL::CWindow
HWND m_hWnd
 

Protected Member Functions

BOOL IsAutoHideState () const override
 
BOOL IsHidingState () const override
 
BOOL IsAlwaysOnTop () const override
 
HMONITOR & GetMonitor () override
 
HMONITOR & GetPreviousMonitor () override
 
INT GetPosition () const override
 
const RECT * GetTrayRect () override
 
HWND GetTrayWnd () const override
 
HWND GetDesktopWnd () const override
 
void SetAutoHideState (_In_ BOOL bAutoHide) override
 
void UpdateAlwaysOnTop (_In_ BOOL bAlwaysOnTop) override
 
- Protected Member Functions inherited from CAppBarManager
PAPPBAR FindAppBar (_In_ HWND hwndAppBar) const
 
void EliminateAppBar (_In_ INT iItem)
 
void DestroyAppBarDPA ()
 
void AppBarSubtractRect (_In_ PAPPBAR pAppBar, _Inout_ PRECT prc)
 
BOOL AppBarOutsideOf (_In_ const APPBAR *pAppBar1, _In_ const APPBAR *pAppBar2)
 
void ComputeHiddenRect (_Inout_ PRECT prc, _In_ UINT uSide)
 
PAPPBAR_COMMAND GetAppBarMessage (_Inout_ PCOPYDATASTRUCT pCopyData)
 
void GetDockedRect (_Out_ PRECT prcDocked)
 
BOOL SetAutoHideBar (_In_ HWND hwndTarget, _In_ BOOL bSetOrReset, _In_ UINT uSide)
 
void OnAppBarActivationChange2 (_In_ HWND hwndNewAutoHide, _In_ UINT uSide)
 
BOOL OnAppBarNew (_In_ const APPBAR_COMMAND *pData)
 
void OnAppBarRemove (_In_ const APPBAR_COMMAND *pData)
 
void OnAppBarQueryPos (_Inout_ PAPPBAR_COMMAND pData)
 
void OnAppBarSetPos (_Inout_ PAPPBAR_COMMAND pData)
 
UINT OnAppBarGetState ()
 
BOOL OnAppBarGetTaskbarPos (_Inout_ PAPPBAR_COMMAND pData)
 
void OnAppBarActivationChange (_In_ const APPBAR_COMMAND *pData)
 
HWND OnAppBarGetAutoHideBar (_In_ UINT uSide)
 
BOOL OnAppBarSetAutoHideBar (_In_ const APPBAR_COMMAND *pData)
 
void OnAppBarSetState (_In_ UINT uState)
 
void OnAppBarNotifyAll (_In_opt_ HMONITOR hMon, _In_opt_ HWND hwndIgnore, _In_ DWORD dwNotify, _In_opt_ LPARAM lParam)
 
WORKAREA_TYPE RecomputeWorkArea (_In_ const RECT *prcTray, _In_ HMONITOR hMonitor, _Out_ PRECT prcWorkArea)
 
void RecomputeAllWorkareas ()
 
void StuckAppChange (_In_opt_ HWND hwndTarget, _In_opt_ const RECT *prcOld, _In_opt_ const RECT *prcNew, _In_ BOOL bTray)
 
void RedrawDesktop (_In_ HWND hwndDesktop, _Inout_ PRECT prc)
 
virtual BOOL IsAutoHideState () const =0
 
virtual BOOL IsHidingState () const =0
 
virtual BOOL IsAlwaysOnTop () const =0
 
virtual HMONITOR & GetMonitor ()=0
 
virtual HMONITOR & GetPreviousMonitor ()=0
 
virtual INT GetPosition () const =0
 
virtual const RECT * GetTrayRect ()=0
 
virtual HWND GetTrayWnd () const =0
 
virtual HWND GetDesktopWnd () const =0
 
virtual void SetAutoHideState (_In_ BOOL bAutoHide)=0
 
virtual void UpdateAlwaysOnTop (_In_ BOOL bAlwaysOnTop)=0
 

Private Attributes

CStartButton m_StartButton
 
CTrayShowDesktopButton * m_pShowDesktopButton
 
CComPtr< IMenuBand > m_StartMenuBand
 
CComPtr< IMenuPopup > m_StartMenuPopup
 
CComPtr< IDeskBand > m_TaskBand
 
CComPtr< IContextMenu > m_ContextMenu
 
HTHEME m_Theme
 
HFONT m_Font
 
HWND m_DesktopWnd
 
HWND m_Rebar
 
HWND m_TaskSwitch
 
HWND m_TrayNotify
 
CComPtr< IUnknown > m_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
 
UINT m_WinMMDevChgMsg
 

Additional Inherited Members

- Public Types inherited from ATL::CWindowImplRoot< TBase >
enum  { WINSTATE_DESTROYED = 0x00000001 }
 
- Public Types inherited from IOleWindow
typedef IOleWindow * LPOLEWINDOW
 
- Public Types inherited from IUnknown
typedef IUnknown * LPUNKNOWN
 
- Public Types inherited from IContextMenu
typedef IContextMenu * LPCONTEXTMENU
 
typedef struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
 
typedef struct IContextMenu::tagCMINVOKECOMMANDINFO * LPCMINVOKECOMMANDINFO
 
typedef struct IContextMenu::tagCMInvokeCommandInfoEx CMINVOKECOMMANDINFOEX
 
typedef struct IContextMenu::tagCMInvokeCommandInfoEx * LPCMINVOKECOMMANDINFOEX
 
- Static Public Attributes inherited from ATL::CWindow
static RECT rcDefault
 
- Static Public Attributes inherited from IContextMenu
static 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}
 
- Static Protected Member Functions inherited from CAppBarManager
static BOOL CALLBACK MonitorEnumProc (_In_ HMONITOR hMonitor, _In_ HDC hDC, _In_ LPRECT prc, _Inout_ LPARAM lParam)
 
- Protected Attributes inherited from CAppBarManager
HDPA m_hAppBarDPA
 
HWND m_ahwndAutoHideBars [4]
 

Detailed Description

Definition at line 309 of file traywnd.cpp.

Constructor & Destructor Documentation

◆ CTrayWindow()

CTrayWindow::CTrayWindow ( )
inline

Definition at line 374 of file traywnd.cpp.

374 :
377 m_Theme(NULL),
378 m_Font(NULL),
380 m_Rebar(NULL),
383 m_Position(0),
393 Flags(0)
394 {
399 }
DWORD m_DraggingPosition
Definition: traywnd.cpp:341
HWND m_TaskSwitch
Definition: traywnd.cpp:333
DWORD Flags
Definition: traywnd.cpp:363
HWND m_Rebar
Definition: traywnd.cpp:332
HMONITOR m_Monitor
Definition: traywnd.cpp:339
CStartButton m_StartButton
Definition: traywnd.cpp:319
DWORD m_Position
Definition: traywnd.cpp:338
HTHEME m_Theme
Definition: traywnd.cpp:327
TRACKMOUSEEVENT m_MouseTrackingInfo
Definition: traywnd.cpp:352
HMONITOR m_PreviousMonitor
Definition: traywnd.cpp:340
HDPA m_ShellServices
Definition: traywnd.cpp:354
SIZE m_TraySize
Definition: traywnd.cpp:345
RECT m_TrayRects[4]
Definition: traywnd.cpp:344
HMONITOR m_DraggingMonitor
Definition: traywnd.cpp:342
UINT m_WinMMDevChgMsg
Definition: traywnd.cpp:356
UINT m_AutoHideState
Definition: traywnd.cpp:350
CTrayShowDesktopButton * m_pShowDesktopButton
Definition: traywnd.cpp:320
HWND m_TrayPropertiesOwner
Definition: traywnd.cpp:347
SIZE m_AutoHideOffset
Definition: traywnd.cpp:351
HWND m_RunFileDlgOwner
Definition: traywnd.cpp:348
HFONT m_Font
Definition: traywnd.cpp:329
HWND m_DesktopWnd
Definition: traywnd.cpp:331
HWND m_TrayNotify
Definition: traywnd.cpp:334
#define NULL
Definition: types.h:112
#define ZeroMemory
Definition: minwinbase.h:31

◆ ~CTrayWindow()

virtual CTrayWindow::~CTrayWindow ( )
inlinevirtual

Definition at line 401 of file traywnd.cpp.

402 {
403 if (m_ShellServices != NULL)
404 {
407 }
408
409 if (m_Font != NULL)
410 {
412 m_Font = NULL;
413 }
414
415 if (m_Theme)
416 {
418 m_Theme = NULL;
419 }
420
422 }
HRESULT ShutdownShellServices(HDPA hdpa)
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:1036
pKey DeleteObject()
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)

Member Function Documentation

◆ _Init()

void CTrayWindow::_Init ( )
inline

Definition at line 3663 of file traywnd.cpp.

3664 {
3665 m_Position = (DWORD) -1;
3666 }
#define DWORD
Definition: nt_native.h:44

◆ AdjustSizerRect()

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

Definition at line 1196 of file traywnd.cpp.

1197 {
1199 SIZE size;
1200
1201 if (pos > ABE_BOTTOM)
1202 pos = ABE_BOTTOM;
1203
1204 HRESULT hr = GetThemePartSize(m_Theme, NULL, iSizerPart[pos], 0, NULL, TS_TRUE, &size);
1206 return;
1207
1208 switch (pos)
1209 {
1210 case ABE_TOP:
1211 rc->bottom -= size.cy;
1212 break;
1213 case ABE_BOTTOM:
1214 rc->top += size.cy;
1215 break;
1216 case ABE_LEFT:
1217 rc->right -= size.cx;
1218 break;
1219 case ABE_RIGHT:
1220 rc->left += size.cx;
1221 break;
1222 }
1223 }
@ TS_TRUE
HRESULT hr
Definition: delayimp.cpp:582
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:33
HRESULT WINAPI GetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, THEMESIZE eSize, SIZE *psz)
Definition: draw.c:1821
GLsizeiptr size
Definition: glext.h:5919
#define ABE_BOTTOM
Definition: shellapi.h:20
#define ABE_RIGHT
Definition: shellapi.h:19
#define ABE_TOP
Definition: shellapi.h:18
#define ABE_LEFT
Definition: shellapi.h:17
long bottom
Definition: dcommon.idl:29
long right
Definition: dcommon.idl:29
long left
Definition: dcommon.idl:29
long top
Definition: dcommon.idl:29
@ TBP_SIZINGBARRIGHT
Definition: vssym32.h:562
@ TBP_SIZINGBARBOTTOM
Definition: vssym32.h:561
@ TBP_SIZINGBARLEFT
Definition: vssym32.h:564
@ TBP_SIZINGBARTOP
Definition: vssym32.h:563

Referenced by Lock(), and OnNcCalcSize().

◆ AlignControls()

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

Definition at line 1735 of file traywnd.cpp.

1736 {
1737 RECT rcClient;
1738 SIZE TraySize, StartSize;
1739 POINT ptTrayNotify = { 0, 0 };
1740 BOOL Horizontal;
1741 HDWP dwp;
1742
1744 if (prcClient != NULL)
1745 {
1746 rcClient = *prcClient;
1747 }
1748 else
1749 {
1750 if (!GetClientRect(&rcClient))
1751 {
1752 ERR("Could not get client rect lastErr=%d\n", GetLastError());
1753 return;
1754 }
1755 }
1756
1757 Horizontal = IsPosHorizontal();
1758
1759 /* We're about to resize/move the start button, the rebar control and
1760 the tray notification control */
1761 dwp = BeginDeferWindowPos(4);
1762 if (dwp == NULL)
1763 {
1764 ERR("BeginDeferWindowPos failed. lastErr=%d\n", GetLastError());
1765 return;
1766 }
1767
1768 /* Limit the Start button width to the client width, if necessary */
1769 StartSize = m_StartButton.GetSize();
1770 if (StartSize.cx > rcClient.right)
1771 StartSize.cx = rcClient.right;
1772
1773 HWND hwndTaskToolbar = ::GetWindow(m_TaskSwitch, GW_CHILD);
1774 if (hwndTaskToolbar)
1775 {
1776 DWORD size = SendMessageW(hwndTaskToolbar, TB_GETBUTTONSIZE, 0, 0);
1777
1778 /* Themed button covers Edge area as well */
1779 StartSize.cy = HIWORD(size) + (m_Theme ? GetSystemMetrics(SM_CYEDGE) : 0);
1780 }
1781
1782 if (m_StartButton.m_hWnd != NULL)
1783 {
1784 /* Resize and reposition the button */
1785 dwp = m_StartButton.DeferWindowPos(dwp,
1786 NULL,
1787 0,
1788 0,
1789 StartSize.cx,
1790 StartSize.cy,
1792 if (dwp == NULL)
1793 {
1794 ERR("DeferWindowPos for start button failed. lastErr=%d\n", GetLastError());
1795 return;
1796 }
1797 }
1798
1799 /* Determine the size that the tray notification window needs */
1800 if (Horizontal)
1801 {
1802 TraySize.cx = 0;
1803 TraySize.cy = rcClient.bottom;
1804 }
1805 else
1806 {
1807 TraySize.cx = rcClient.right;
1808 TraySize.cy = 0;
1809 }
1810
1811 if (m_TrayNotify != NULL &&
1814 (WPARAM)Horizontal,
1815 (LPARAM)&TraySize))
1816 {
1817 /* Move the tray notification window to the desired location */
1818 if (Horizontal)
1819 ptTrayNotify.x = rcClient.right - TraySize.cx;
1820 else
1821 ptTrayNotify.y = rcClient.bottom - TraySize.cy;
1822
1823 dwp = ::DeferWindowPos(dwp,
1825 NULL,
1826 ptTrayNotify.x,
1827 ptTrayNotify.y,
1828 TraySize.cx,
1829 TraySize.cy,
1831 if (dwp == NULL)
1832 {
1833 ERR("DeferWindowPos for notification area failed. lastErr=%d\n", GetLastError());
1834 return;
1835 }
1836 }
1837
1838 /* Resize/Move the rebar control */
1839 if (m_Rebar != NULL)
1840 {
1841 POINT ptRebar = { 0, 0 };
1842 SIZE szRebar;
1843
1844 SetWindowStyle(m_Rebar, CCS_VERT, Horizontal ? 0 : CCS_VERT);
1845
1846 if (Horizontal)
1847 {
1848 ptRebar.x = StartSize.cx + GetSystemMetrics(SM_CXSIZEFRAME);
1849 szRebar.cx = ptTrayNotify.x - ptRebar.x;
1850 szRebar.cy = rcClient.bottom;
1851 }
1852 else
1853 {
1854 ptRebar.y = StartSize.cy + GetSystemMetrics(SM_CYSIZEFRAME);
1855 szRebar.cx = rcClient.right;
1856 szRebar.cy = ptTrayNotify.y - ptRebar.y;
1857 }
1858
1859 dwp = ::DeferWindowPos(dwp,
1860 m_Rebar,
1861 NULL,
1862 ptRebar.x,
1863 ptRebar.y,
1864 szRebar.cx,
1865 szRebar.cy,
1867 }
1868
1869 if (dwp != NULL)
1870 EndDeferWindowPos(dwp);
1871
1872 if (m_TaskSwitch != NULL)
1873 {
1874 /* Update the task switch window configuration */
1876 }
1877 }
#define ERR(fmt,...)
Definition: precomp.h:57
#define TSWM_UPDATETASKBARPOS
Definition: precomp.h:397
#define TNWM_GETMINIMUMSIZE
Definition: precomp.h:380
static LONG SetWindowStyle(IN HWND hWnd, IN LONG dwStyleMask, IN LONG dwStyle)
Definition: precomp.h:75
HDWP DeferWindowPos(HDWP hWinPosInfo, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags)
Definition: atlwin.h:456
HWND m_hWnd
Definition: atlwin.h:273
SIZE GetSize()
Definition: traywnd.cpp:207
VOID UpdateSize()
Definition: traywnd.cpp:212
BOOL IsPosHorizontal()
Definition: traywnd.cpp:1271
STDMETHODIMP GetWindow(HWND *phwnd) override
Definition: traywnd.cpp:3649
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG_PTR LPARAM
Definition: minwindef.h:175
UINT_PTR WPARAM
Definition: minwindef.h:174
#define TB_GETBUTTONSIZE
Definition: commctrl.h:1160
#define CCS_VERT
Definition: commctrl.h:2254
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define SM_CYEDGE
Definition: winuser.h:1020
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SendMessage
Definition: winuser.h:6009
#define SM_CXSIZEFRAME
Definition: winuser.h:1004
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define GW_CHILD
Definition: winuser.h:774
#define SWP_NOZORDER
Definition: winuser.h:1258
#define SM_CYSIZEFRAME
Definition: winuser.h:1006
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HDWP WINAPI BeginDeferWindowPos(_In_ int)
long y
Definition: dcommon.idl:24
long x
Definition: dcommon.idl:24
Definition: dcommon.idl:28
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
#define HIWORD(l)
Definition: typedefs.h:247
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

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

◆ ApplyClipping()

VOID CTrayWindow::ApplyClipping ( IN BOOL  Clip)
inline

Definition at line 1546 of file traywnd.cpp.

1547 {
1548 RECT rcClip, rcWindow;
1549 HRGN hClipRgn;
1550
1551 if (GetWindowRect(&rcWindow))
1552 {
1553 /* Disable clipping on systems with only one monitor */
1555 Clip = FALSE;
1556
1557 if (Clip)
1558 {
1559 rcClip = rcWindow;
1560
1561 GetScreenRect(m_Monitor, &rcClip);
1562
1563 if (!IntersectRect(&rcClip, &rcClip, &rcWindow))
1564 {
1565 rcClip = rcWindow;
1566 }
1567
1568 OffsetRect(&rcClip,
1569 -rcWindow.left,
1570 -rcWindow.top);
1571
1572 hClipRgn = CreateRectRgnIndirect(&rcClip);
1573 }
1574 else
1575 hClipRgn = NULL;
1576
1577 /* Set the clipping region or make sure the window isn't clipped
1578 by disabling it explicitly. */
1579 SetWindowRgn(hClipRgn, TRUE);
1580 }
1581 }
HMONITOR GetScreenRect(IN HMONITOR hMonitor, IN OUT RECT *pRect)
Definition: traywnd.cpp:1158
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
int WINAPI SetWindowRgn(_In_ HWND, _In_opt_ HRGN, _In_ BOOL)
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define SM_CMONITORS
Definition: winuser.h:1051
HRGN WINAPI CreateRectRgnIndirect(_In_ LPCRECT)

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

◆ CalculateValidSize()

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

Definition at line 1276 of file traywnd.cpp.

1279 {
1280 RECT rcScreen;
1281 //BOOL Horizontal;
1282 HMONITOR hMon;
1283 SIZE szMax, szWnd;
1284
1285 //Horizontal = IsPosHorizontal();
1286
1287 szWnd.cx = pRect->right - pRect->left;
1288 szWnd.cy = pRect->bottom - pRect->top;
1289
1290 rcScreen = *pRect;
1291 hMon = GetScreenRectFromRect(
1292 &rcScreen,
1293 MONITOR_DEFAULTTONEAREST);
1294
1295 /* Calculate the maximum size of the tray window and limit the window
1296 size to half of the screen's size. */
1297 szMax.cx = (rcScreen.right - rcScreen.left) / 2;
1298 szMax.cy = (rcScreen.bottom - rcScreen.top) / 2;
1299 if (szWnd.cx > szMax.cx)
1300 szWnd.cx = szMax.cx;
1301 if (szWnd.cy > szMax.cy)
1302 szWnd.cy = szMax.cy;
1303
1304 /* FIXME - calculate */
1305
1307 &rcScreen,
1308 &szWnd,
1309 pRect);
1310
1311 return hMon;
1312 }
HMONITOR GetScreenRectFromRect(IN OUT RECT *pRect, IN DWORD dwFlags)
Definition: traywnd.cpp:1106
VOID GetTrayRectFromScreenRect(IN DWORD Position, IN const RECT *pScreen, IN const SIZE *pTraySize OPTIONAL, OUT RECT *pRect)
Definition: traywnd.cpp:1250
static COORD Position
Definition: mouse.c:34

Referenced by FitToRebar().

◆ ChangingWinPos()

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

Definition at line 1453 of file traywnd.cpp.

1454 {
1455 RECT rcTray;
1456
1457 if (IsDragging)
1458 {
1459 rcTray.left = pwp->x;
1460 rcTray.top = pwp->y;
1461 rcTray.right = rcTray.left + pwp->cx;
1462 rcTray.bottom = rcTray.top + pwp->cy;
1463
1464 if (!EqualRect(&rcTray,
1466 {
1467 /* Recalculate the rectangle, the user dragged the tray
1468 window to another monitor or the window was somehow else
1469 moved or resized */
1471 &rcTray,
1473 //m_TrayRects[DraggingPosition] = rcTray;
1474 }
1475
1476 //Monitor = CalculateValidSize(DraggingPosition,
1477 // &rcTray);
1478
1483 IsDragging = FALSE;
1484
1485 m_TrayRects[m_Position] = rcTray;
1486 goto ChangePos;
1487 }
1488 else if (GetWindowRect(&rcTray))
1489 {
1490 if (InSizeMove)
1491 {
1492 if (!(pwp->flags & SWP_NOMOVE))
1493 {
1494 rcTray.left = pwp->x;
1495 rcTray.top = pwp->y;
1496 }
1497
1498 if (!(pwp->flags & SWP_NOSIZE))
1499 {
1500 rcTray.right = rcTray.left + pwp->cx;
1501 rcTray.bottom = rcTray.top + pwp->cy;
1502 }
1503
1505
1506 if (!(pwp->flags & (SWP_NOMOVE | SWP_NOSIZE)))
1507 {
1508 SIZE szWnd;
1509
1510 szWnd.cx = pwp->cx;
1511 szWnd.cy = pwp->cy;
1512
1513 MakeTrayRectWithSize(m_Position, &szWnd, &rcTray);
1514 }
1515
1516 m_TrayRects[m_Position] = rcTray;
1517 }
1518 else if (m_Position != (DWORD)-1)
1519 {
1520 /* If the user isn't resizing the tray window we need to make sure the
1521 new size or position is valid. this is to prevent changes to the window
1522 without user interaction. */
1523 rcTray = m_TrayRects[m_Position];
1524
1525 if (IsAutoHideState())
1526 {
1527 rcTray.left += m_AutoHideOffset.cx;
1528 rcTray.right += m_AutoHideOffset.cx;
1529 rcTray.top += m_AutoHideOffset.cy;
1530 rcTray.bottom += m_AutoHideOffset.cy;
1531 }
1532 }
1533
1534ChangePos:
1535 m_TraySize.cx = rcTray.right - rcTray.left;
1536 m_TraySize.cy = rcTray.bottom - rcTray.top;
1537
1538 pwp->flags &= ~(SWP_NOMOVE | SWP_NOSIZE);
1539 pwp->x = rcTray.left;
1540 pwp->y = rcTray.top;
1541 pwp->cx = m_TraySize.cx;
1542 pwp->cy = m_TraySize.cy;
1543 }
1544 }
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
DWORD InSizeMove
Definition: traywnd.cpp:367
BOOL IsAutoHideState() const override
Definition: traywnd.cpp:3687
DWORD IsDragging
Definition: traywnd.cpp:368
VOID MakeTrayRectWithSize(IN DWORD Position, IN const SIZE *pTraySize, IN OUT RECT *pRect)
Definition: traywnd.cpp:1225
DWORD GetDraggingRectFromRect(IN OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1435
#define SWP_NOMOVE
Definition: winuser.h:1255
#define SWP_NOSIZE
Definition: winuser.h:1256
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
TW_STRUCKRECTS2 sr
Definition: precomp.h:228
DWORD Position
Definition: precomp.h:213

Referenced by OnWindowPosChanging().

◆ CheckTrayWndPosition()

VOID CTrayWindow::CheckTrayWndPosition ( )
inline

Definition at line 1635 of file traywnd.cpp.

1636 {
1637 /* Force the rebar bands to resize */
1639 IID_IDeskBand,
1641 0,
1642 NULL,
1643 NULL);
1644
1645 /* Calculate the size of the taskbar based on the rebar */
1647
1648 /* Move the tray window */
1649 /* The handler of WM_WINDOWPOSCHANGING will override whatever size
1650 * and position we use here with m_TrayRects */
1655 }
VOID ResizeWorkArea()
Definition: traywnd.cpp:1583
void FitToRebar(PRECT pRect)
Definition: traywnd.cpp:1879
CComPtr< ITrayBandSite > m_TrayBandSite
Definition: traywnd.cpp:359
VOID ApplyClipping(IN BOOL Clip)
Definition: traywnd.cpp:1546
HRESULT WINAPI IUnknown_Exec(IUnknown *lpUnknown, REFGUID pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: ordinal.c:762
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define RDW_ERASE
Definition: winuser.h:1222
#define RDW_ALLCHILDREN
Definition: winuser.h:1232
#define RDW_FRAME
Definition: winuser.h:1223
#define RDW_INTERNALPAINT
Definition: winuser.h:1224
#define RDW_INVALIDATE
Definition: winuser.h:1225
@ DBID_BANDINFOCHANGED
Definition: shobjidl.idl:2593

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

◆ Close()

HRESULT STDMETHODCALLTYPE CTrayWindow::Close ( )
inline

Definition at line 2221 of file traywnd.cpp.

2222 {
2223 if (m_hWnd != NULL)
2224 {
2227 0,
2228 0);
2229 }
2230
2231 return S_OK;
2232 }
#define S_OK
Definition: intsafe.h:52
#define WM_APP_TRAYDESTROY
Definition: traywnd.cpp:17

◆ ContextSensitiveHelp()

STDMETHODIMP CTrayWindow::ContextSensitiveHelp ( BOOL  fEnterMode)
inlineoverride

Implements IOleWindow.

Definition at line 3658 of file traywnd.cpp.

3659 {
3660 return E_NOTIMPL;
3661 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DisplayProperties()

HWND STDMETHODCALLTYPE CTrayWindow::DisplayProperties ( )
inline

Definition at line 598 of file traywnd.cpp.

599 {
600 HWND hTrayProp;
601
603 {
605 if (hTrayProp != NULL &&
606 hTrayProp != m_TrayPropertiesOwner)
607 {
608 SetForegroundWindow(hTrayProp);
609 return NULL;
610 }
611 }
612
614 if (hThread)
616 return NULL;
617 }
HWND GetLastActivePopup() const
Definition: atlwin.h:676
static DWORD WINAPI s_TrayPropertiesThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:591
#define CloseHandle
Definition: compat.h:739
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:137
HANDLE hThread
Definition: wizard.c:28
BOOL WINAPI SetForegroundWindow(_In_ HWND)

Referenced by ExecContextMenuCmd(), and HandleCommand().

◆ DisplayRunFileDlg()

void CTrayWindow::DisplayRunFileDlg ( )
inline

Definition at line 543 of file traywnd.cpp.

544 {
545 HWND hRunDlg;
547 {
549 if (hRunDlg != NULL &&
550 hRunDlg != m_RunFileDlgOwner)
551 {
552 SetForegroundWindow(hRunDlg);
553 return;
554 }
555 }
556
558 if (hThread)
560 }
static DWORD WINAPI s_RunFileDlgThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:537

Referenced by HandleCommand(), and HandleHotKey().

◆ DoExitWindows()

LRESULT CTrayWindow::DoExitWindows ( )
inline

Definition at line 472 of file traywnd.cpp.

473 {
475 return 0;
476
477 if (GetAsyncKeyState(VK_SHIFT) < 0 ||
478 !SHGetValueW(HKEY_CURRENT_USER, REGSTR_PATH_EXPLORER L"\\Advanced", L"StartMenuForceRefresh", NULL, NULL, NULL))
479 {
481 }
482
483 SaveState();
484
485 /* Display the ReactOS Shutdown Dialog */
487
488 /*
489 * If the user presses CTRL+ALT+SHIFT while exiting
490 * the shutdown dialog, exit the shell cleanly.
491 */
492 if ((GetKeyState(VK_CONTROL) & 0x8000) &&
493 (GetKeyState(VK_SHIFT) & 0x8000) &&
494 (GetKeyState(VK_MENU) & 0x8000))
495 {
496 PostMessage(WM_QUIT, 0, 0);
497 }
498 return 0;
499 }
void RefreshStartMenuSettings()
Definition: traywnd.cpp:467
void SaveState()
Definition: traywnd.cpp:456
DWORD WINAPI SHGetValueW(HKEY hkey, const WCHAR *subkey, const WCHAR *value, DWORD *type, void *data, DWORD *data_len)
Definition: main.c:2222
void WINAPI ExitWindowsDialog(HWND hWndOwner)
Definition: dialogs.cpp:1604
#define L(x)
Definition: resources.c:13
#define WM_QUIT
Definition: winuser.h:1651
#define VK_CONTROL
Definition: winuser.h:2239
#define PostMessage
Definition: winuser.h:5998
#define VK_SHIFT
Definition: winuser.h:2238
SHORT WINAPI GetAsyncKeyState(_In_ int)
SHORT WINAPI GetKeyState(_In_ int)
#define VK_MENU
Definition: winuser.h:2240
#define REGSTR_PATH_EXPLORER
Definition: regstr.h:33
@ REST_NOCLOSE
Definition: shlobj.h:1661
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
Definition: shpolicy.c:166
#define HKEY_CURRENT_USER
Definition: winreg.h:11

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

◆ DrawShowDesktopButton()

void CTrayWindow::DrawShowDesktopButton ( )
inline

Definition at line 2625 of file traywnd.cpp.

2626 {
2627 if (!m_pShowDesktopButton || !m_pShowDesktopButton->IsWindow())
2628 return;
2630 }
#define RDW_UPDATENOW
Definition: winuser.h:1231
#define RDW_ERASENOW
Definition: winuser.h:1230

Referenced by OnNcActivate(), and OnNcPaint().

◆ DrawSizerWithTheme()

int CTrayWindow::DrawSizerWithTheme ( IN HRGN  hRgn)
inline

Definition at line 2140 of file traywnd.cpp.

2141 {
2142 HDC hdc;
2143 RECT rect;
2145 SIZE size;
2146
2148
2151 return 0;
2152
2155
2156 hdc = GetWindowDC();
2157
2158 switch (m_Position)
2159 {
2160 case ABE_LEFT:
2161 rect.left = rect.right - size.cx;
2162 break;
2163 case ABE_TOP:
2164 rect.top = rect.bottom - size.cy;
2165 break;
2166 case ABE_RIGHT:
2167 rect.right = rect.left + size.cx;
2168 break;
2169 case ABE_BOTTOM:
2170 default:
2171 rect.bottom = rect.top + size.cy;
2172 break;
2173 }
2174
2175 DrawThemeBackground(m_Theme, hdc, iSizerPart[m_Position], 0, &rect, 0);
2176
2177 ReleaseDC(hdc);
2178 return 0;
2179 }
HDC GetWindowDC()
Definition: atlwin.h:784
RECT rect
Definition: combotst.c:67
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
#define ASSERT(a)
Definition: mode.c:44
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)

Referenced by OnNcPaint().

◆ EjectThreadProc()

static DWORD CALLBACK CTrayWindow::EjectThreadProc ( LPVOID  arg)
inlinestatic

Definition at line 808 of file traywnd.cpp.

809 {
811 return 0;
812 }
CONFIGRET WINAPI CM_Request_Eject_PC(VOID)
Definition: cfgmgr.c:7767

Referenced by HandleCommand().

◆ EraseBackgroundWithTheme()

LRESULT CTrayWindow::EraseBackgroundWithTheme ( HDC  hdc)
inline

Definition at line 2124 of file traywnd.cpp.

2125 {
2126 RECT rect;
2128
2130
2131 if (m_Theme)
2132 {
2134 DrawThemeBackground(m_Theme, hdc, iSBkgndPart[m_Position], 0, &rect, 0);
2135 }
2136
2137 return 0;
2138 }
@ TBP_BACKGROUNDLEFT
Definition: vssym32.h:560
@ TBP_BACKGROUNDRIGHT
Definition: vssym32.h:558
@ TBP_BACKGROUNDTOP
Definition: vssym32.h:559
@ TBP_BACKGROUNDBOTTOM
Definition: vssym32.h:557

Referenced by OnEraseBackground().

◆ ExecContextMenuCmd()

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

Definition at line 659 of file traywnd.cpp.

660 {
661 switch (uiCmd)
662 {
665 break;
666
669 TEXT("open"));
670 break;
671
674 TEXT("explore"));
675 break;
676
677 case ID_LOCKTASKBAR:
679 break;
680
683 break;
684
687 break;
688
690 ShowDesktop();
691 break;
692
695 if (g_Arrangement == NONE)
696 {
698 }
702 break;
703
706 if (g_Arrangement == NONE)
707 {
709 }
713 break;
714
717 if (g_Arrangement == NONE)
718 {
720 }
724 break;
725
728 break;
729
731 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
732 break;
733
735 RestoreAll();
736 break;
737
738 default:
739 TRACE("ITrayWindow::ExecContextMenuCmd(%u): Unhandled Command ID!\n", uiCmd);
740 return FALSE;
741 }
742
743 return TRUE;
744 }
#define ID_SHELL_CMD_OPEN_TASKMGR
Definition: resource.h:215
#define ID_SHELL_CMD_CUST_NOTIF
Definition: resource.h:221
#define ID_SHELL_CMD_UNDO_ACTION
Definition: resource.h:216
#define ID_SHELL_CMD_PROPERTIES
Definition: resource.h:211
#define ID_SHELL_CMD_TILE_WND_H
Definition: resource.h:219
#define ID_SHELL_CMD_CASCADE_WND
Definition: resource.h:220
#define ID_SHELL_CMD_RESTORE_ALL
Definition: resource.h:223
#define ID_SHELL_CMD_TILE_WND_V
Definition: resource.h:218
#define ID_LOCKTASKBAR
Definition: resource.h:214
#define ID_SHELL_CMD_SHOW_DESKTOP
Definition: resource.h:217
#define ID_SHELL_CMD_EXPLORE_ALL_USERS
Definition: resource.h:213
#define ID_SHELL_CMD_ADJUST_DAT
Definition: resource.h:222
#define ID_SHELL_CMD_OPEN_ALL_USERS
Definition: resource.h:212
void OnAppBarNotifyAll(_In_opt_ HMONITOR hMon, _In_opt_ HWND hwndIgnore, _In_ DWORD dwNotify, _In_opt_ LPARAM lParam)
Definition: appbar.cpp:207
VOID OpenTaskManager(IN HWND hWndOwner)
Definition: traywnd.cpp:637
VOID ShowDesktop()
Definition: traywnd.cpp:3235
LRESULT HandleCommand(UINT uCommand)
Definition: traywnd.cpp:814
VOID RestoreAll()
Definition: traywnd.cpp:3240
HWND STDMETHODCALLTYPE DisplayProperties()
Definition: traywnd.cpp:598
VOID OpenCommonStartMenuDirectory(IN HWND hWndOwner, IN LPCTSTR lpOperation)
Definition: traywnd.cpp:619
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
#define TEXT(s)
Definition: k32.h:28
VOID ShowCustomizeNotifyIcons(HINSTANCE hInst, HWND hExplorer)
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)
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 MDITILE_SKIPDISABLED
Definition: winuser.h:2223
#define MDITILE_HORIZONTAL
Definition: winuser.h:2224
#define MDITILE_VERTICAL
Definition: winuser.h:2225
#define SW_NORMAL
Definition: winuser.h:780
#define ABN_WINDOWARRANGE
Definition: shellapi.h:75
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2787
#define TRACE(s)
Definition: solgame.cpp:4
enum @125 g_Arrangement
@ TILED
Definition: traywnd.cpp:49
@ NONE
Definition: traywnd.cpp:49
@ CASCADED
Definition: traywnd.cpp:49
VOID RestoreWindowPos()
Definition: traywnd.cpp:78
VOID BackupWindowPos()
Definition: traywnd.cpp:73
#define TRAYCMD_LOCK_TASKBAR
Definition: undocshell.h:1011

◆ ExecResourceCmd()

HRESULT CTrayWindow::ExecResourceCmd ( int  id)
inline

Definition at line 432 of file traywnd.cpp.

433 {
434 WCHAR szCommand[256];
435 WCHAR *pszParameters;
436
438 id,
439 szCommand,
440 _countof(szCommand)))
441 {
442 return E_FAIL;
443 }
444
445 pszParameters = wcschr(szCommand, L'>');
446 if (pszParameters)
447 {
448 *pszParameters = 0;
449 pszParameters++;
450 }
451
452 ShellExecuteW(m_hWnd, NULL, szCommand, pszParameters, NULL, SW_SHOWNORMAL);
453 return S_OK;
454 }
#define E_FAIL
Definition: ddrawi.h:102
#define wcschr
Definition: compat.h:17
short WCHAR
Definition: pedump.c:58
#define SW_SHOWNORMAL
Definition: winuser.h:781
#define LoadStringW
Definition: utils.h:64
#define _countof(array)
Definition: sndvol32.h:70

Referenced by HandleCommand(), and HandleHotKey().

◆ FitToRebar()

void CTrayWindow::FitToRebar ( PRECT  pRect)
inline

Definition at line 1879 of file traywnd.cpp.

1880 {
1881 /* Get the rect of the rebar */
1882 RECT rebarRect, taskbarRect, clientRect;
1883 ::GetWindowRect(m_Rebar, &rebarRect);
1884 ::GetWindowRect(m_hWnd, &taskbarRect);
1885 ::GetClientRect(m_hWnd, &clientRect);
1886 OffsetRect(&rebarRect, -taskbarRect.left, -taskbarRect.top);
1887
1888 /* Calculate the difference of size of the taskbar and the rebar */
1889 SIZE margins;
1890 margins.cx = taskbarRect.right - taskbarRect.left - clientRect.right + clientRect.left;
1891 margins.cy = taskbarRect.bottom - taskbarRect.top - clientRect.bottom + clientRect.top;
1892
1893 /* Calculate the new size of the rebar and make it resize, then change the new taskbar size */
1894 switch (m_Position)
1895 {
1896 case ABE_TOP:
1897 rebarRect.bottom = rebarRect.top + pRect->bottom - pRect->top - margins.cy;
1899 pRect->bottom = pRect->top + rebarRect.bottom - rebarRect.top + margins.cy;
1900 break;
1901 case ABE_BOTTOM:
1902 rebarRect.top = rebarRect.bottom - (pRect->bottom - pRect->top - margins.cy);
1904 pRect->top = pRect->bottom - (rebarRect.bottom - rebarRect.top + margins.cy);
1905 break;
1906 case ABE_LEFT:
1907 rebarRect.right = rebarRect.left + (pRect->right - pRect->left - margins.cx);
1909 pRect->right = pRect->left + (rebarRect.right - rebarRect.left + margins.cx);
1910 break;
1911 case ABE_RIGHT:
1912 rebarRect.left = rebarRect.right - (pRect->right - pRect->left - margins.cx);
1914 pRect->left = pRect->right - (rebarRect.right - rebarRect.left + margins.cx);
1915 break;
1916 }
1917
1919 }
static RECT margins
Definition: print.c:55
HMONITOR CalculateValidSize(IN DWORD Position, IN OUT RECT *pRect)
Definition: traywnd.cpp:1276
#define RBSTR_CHANGERECT
Definition: commctrl.h:1596
#define RB_SIZETORECT
Definition: commctrl.h:1598
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106

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 2344 of file traywnd.cpp.

2349 {
2350 if (!m_ContextMenu)
2351 return E_INVALIDARG;
2352
2353 return m_ContextMenu->GetCommandString(idCmd, uType, pwReserved, pszName, cchMax);
2354 }
UINT cchMax
CComPtr< IContextMenu > m_ContextMenu
Definition: traywnd.cpp:326
#define E_INVALIDARG
Definition: ddrawi.h:101

◆ GetDesktopWnd()

HWND CTrayWindow::GetDesktopWnd ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3695 of file traywnd.cpp.

3695{ return m_DesktopWnd; }

◆ GetDraggingRectFromPt()

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

Definition at line 1333 of file traywnd.cpp.

1337 {
1338 HMONITOR hMon, hMonNew;
1339 DWORD PosH, PosV, Pos;
1340 SIZE DeltaPt, ScreenOffset;
1341 RECT rcScreen;
1342
1343 rcScreen.left = 0;
1344 rcScreen.top = 0;
1345
1346 /* Determine the screen rectangle */
1347 hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONULL);
1348 if (hMon != NULL)
1349 {
1351
1352 mi.cbSize = sizeof(mi);
1353 if (!GetMonitorInfo(hMon, &mi))
1354 {
1355 hMon = NULL;
1356 goto GetPrimaryScreenRect;
1357 }
1358
1359 /* make left top corner of the screen zero based to
1360 make calculations easier */
1361 pt.x -= mi.rcMonitor.left;
1362 pt.y -= mi.rcMonitor.top;
1363
1364 ScreenOffset.cx = mi.rcMonitor.left;
1365 ScreenOffset.cy = mi.rcMonitor.top;
1366 rcScreen.right = mi.rcMonitor.right - mi.rcMonitor.left;
1367 rcScreen.bottom = mi.rcMonitor.bottom - mi.rcMonitor.top;
1368 }
1369 else
1370 {
1371GetPrimaryScreenRect:
1372 ScreenOffset.cx = 0;
1373 ScreenOffset.cy = 0;
1376 }
1377
1378 /* Calculate the nearest screen border */
1379 if (pt.x < rcScreen.right / 2)
1380 {
1381 DeltaPt.cx = pt.x;
1382 PosH = ABE_LEFT;
1383 }
1384 else
1385 {
1386 DeltaPt.cx = rcScreen.right - pt.x;
1387 PosH = ABE_RIGHT;
1388 }
1389
1390 if (pt.y < rcScreen.bottom / 2)
1391 {
1392 DeltaPt.cy = pt.y;
1393 PosV = ABE_TOP;
1394 }
1395 else
1396 {
1397 DeltaPt.cy = rcScreen.bottom - pt.y;
1398 PosV = ABE_BOTTOM;
1399 }
1400
1401 Pos = (DeltaPt.cx * rcScreen.bottom < DeltaPt.cy * rcScreen.right) ? PosH : PosV;
1402
1403 /* Fix the screen origin to be relative to the primary monitor again */
1404 OffsetRect(&rcScreen,
1405 ScreenOffset.cx,
1406 ScreenOffset.cy);
1407
1408 RECT rcPos = m_TrayRects[Pos];
1409
1410 hMonNew = GetMonitorFromRect(&rcPos);
1411 if (hMon != hMonNew)
1412 {
1413 SIZE szTray;
1414
1415 /* Recalculate the rectangle, we're dragging to another monitor.
1416 We don't need to recalculate the rect on single monitor systems. */
1417 szTray.cx = rcPos.right - rcPos.left;
1418 szTray.cy = rcPos.bottom - rcPos.top;
1419
1420 GetTrayRectFromScreenRect(Pos, &rcScreen, &szTray, pRect);
1421 hMon = hMonNew;
1422 }
1423 else
1424 {
1425 /* The user is dragging the tray window on the same monitor. We don't need
1426 to recalculate the rectangle */
1427 *pRect = rcPos;
1428 }
1429
1430 *phMonitor = hMon;
1431
1432 return Pos;
1433 }
HMONITOR GetMonitorFromRect(IN const RECT *pRect)
Definition: traywnd.cpp:1133
ush Pos
Definition: deflate.h:92
#define pt(x, y)
Definition: drawing.c:79
static MONITORINFO mi
Definition: win.c:9400
HMONITOR WINAPI MonitorFromPoint(POINT, DWORD)
#define GetMonitorInfo
Definition: winuser.h:5957
#define SM_CYSCREEN
Definition: winuser.h:971
#define SM_CXSCREEN
Definition: winuser.h:970
RECT rcMonitor
Definition: winuser.h:3893
DWORD cbSize
Definition: winuser.h:3892

Referenced by GetDraggingRectFromRect(), and OnMoving().

◆ GetDraggingRectFromRect()

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

Definition at line 1435 of file traywnd.cpp.

1438 {
1439 POINT pt;
1440
1441 /* Calculate the center of the rectangle. We call
1442 GetDraggingRectFromPt to calculate a valid
1443 dragging rectangle */
1444 pt.x = pRect->left + ((pRect->right - pRect->left) / 2);
1445 pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2);
1446
1447 return GetDraggingRectFromPt(
1448 pt,
1449 pRect,
1450 phMonitor);
1451 }
DWORD GetDraggingRectFromPt(IN POINT pt, OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1333

Referenced by ChangingWinPos().

◆ GetHWND()

HWND STDMETHODCALLTYPE CTrayWindow::GetHWND ( )
inline

Definition at line 2234 of file traywnd.cpp.

2235 {
2236 return m_hWnd;
2237 }

◆ GetMonitor()

HMONITOR & CTrayWindow::GetMonitor ( )
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3690 of file traywnd.cpp.

3690{ return m_Monitor; }

◆ GetMonitorFromRect()

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

Definition at line 1133 of file traywnd.cpp.

1135 {
1136 HMONITOR hMon;
1137
1138 /* In case the monitor sizes or saved sizes differ a bit (probably
1139 not a lot, only so the tray window overlaps into another monitor
1140 now), minimize the risk that we determine a wrong monitor by
1141 using the center point of the tray window if we can't determine
1142 it using the rectangle. */
1143 hMon = MonitorFromRect(pRect, MONITOR_DEFAULTTONULL);
1144 if (hMon == NULL)
1145 {
1146 POINT pt;
1147
1148 pt.x = pRect->left + ((pRect->right - pRect->left) / 2);
1149 pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2);
1150
1151 /* be less error-prone, find the nearest monitor */
1152 hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);
1153 }
1154
1155 return hMon;
1156 }
HMONITOR WINAPI MonitorFromRect(LPCRECT, DWORD)

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

◆ GetPosition()

INT CTrayWindow::GetPosition ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3692 of file traywnd.cpp.

3692{ return m_Position; }

◆ GetPreviousMonitor()

HMONITOR & CTrayWindow::GetPreviousMonitor ( )
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3691 of file traywnd.cpp.

3691{ return m_PreviousMonitor; }

◆ GetScreenRect()

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

Definition at line 1158 of file traywnd.cpp.

1161 {
1162 HMONITOR hMon = NULL;
1163
1164 if (hMonitor != NULL)
1165 {
1167
1168 mi.cbSize = sizeof(mi);
1169 if (!GetMonitorInfo(hMonitor, &mi))
1170 {
1171 /* Hm, the monitor is gone? Try to find a monitor where it
1172 could be located now */
1173 hMon = GetMonitorFromRect(pRect);
1174 if (hMon == NULL ||
1175 !GetMonitorInfo(hMon, &mi))
1176 {
1177 hMon = NULL;
1178 goto GetPrimaryRect;
1179 }
1180 }
1181
1182 *pRect = mi.rcMonitor;
1183 }
1184 else
1185 {
1186GetPrimaryRect:
1187 pRect->left = 0;
1188 pRect->top = 0;
1189 pRect->right = GetSystemMetrics(SM_CXSCREEN);
1190 pRect->bottom = GetSystemMetrics(SM_CYSCREEN);
1191 }
1192
1193 return hMon;
1194 }

Referenced by ApplyClipping(), and ResizeWorkArea().

◆ GetScreenRectFromRect()

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

Definition at line 1106 of file traywnd.cpp.

1109 {
1111 HMONITOR hMon;
1112
1113 mi.cbSize = sizeof(mi);
1114 hMon = MonitorFromRect(pRect, dwFlags);
1115 if (hMon != NULL &&
1116 GetMonitorInfo(hMon, &mi))
1117 {
1118 *pRect = mi.rcMonitor;
1119 }
1120 else
1121 {
1122 pRect->left = 0;
1123 pRect->top = 0;
1124 pRect->right = GetSystemMetrics(SM_CXSCREEN);
1125 pRect->bottom = GetSystemMetrics(SM_CYSCREEN);
1126
1127 hMon = NULL;
1128 }
1129
1130 return hMon;
1131 }
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141

Referenced by CalculateValidSize(), and RegLoadSettings().

◆ GetState()

CTrayWindow::GetState ( )
inlineoverride

Definition at line 3609 of file traywnd.cpp.

3610 {
3611 /* FIXME: Return ABS_ flags? */
3612 TRACE("IShellDesktopTray::GetState() unimplemented!\n");
3613 return 0;
3614 }

◆ GetTrayRect()

const RECT * CTrayWindow::GetTrayRect ( )
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3693 of file traywnd.cpp.

3693{ return &m_TrayRects[m_Position]; }

◆ GetTrayRectFromScreenRect()

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

Definition at line 1250 of file traywnd.cpp.

1254 {
1255 if (pTraySize == NULL)
1256 pTraySize = &m_TraySize;
1257
1258 *pRect = *pScreen;
1259
1260 if(!m_Theme)
1261 {
1262 /* Move the border outside of the screen */
1263 InflateRect(pRect,
1266 }
1267
1268 MakeTrayRectWithSize(Position, pTraySize, pRect);
1269 }
#define SM_CXEDGE
Definition: winuser.h:1019
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)

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

◆ GetTrayWindow()

STDMETHODIMP CTrayWindow::GetTrayWindow ( OUT HWND *  phWndTray)
inlineoverride

Definition at line 3617 of file traywnd.cpp.

3618 {
3619 TRACE("IShellDesktopTray::GetTrayWindow(0x%p)\n", phWndTray);
3620 *phWndTray = m_hWnd;
3621 return S_OK;
3622 }

◆ GetTrayWnd()

HWND CTrayWindow::GetTrayWnd ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3694 of file traywnd.cpp.

3694{ return m_hWnd; }

◆ GetWindow()

STDMETHODIMP CTrayWindow::GetWindow ( HWND *  phwnd)
inlineoverride

Implements IOleWindow.

Definition at line 3649 of file traywnd.cpp.

3650 {
3651 if (!phwnd)
3652 return E_INVALIDARG;
3653 *phwnd = m_hWnd;
3654 return S_OK;
3655 }

Referenced by AlignControls(), IsTaskWnd(), and MinimizeWindowsProc().

◆ HandleCommand()

LRESULT CTrayWindow::HandleCommand ( UINT  uCommand)
inline

Definition at line 814 of file traywnd.cpp.

815 {
816 switch (uCommand)
817 {
820#if 0 // FIXME: This won't work
823#else
825#endif
826 break;
830 break;
832 SaveState();
833 LogoffWindowsDialog(m_hWnd); // FIXME: Maybe handle it in a similar way as DoExitWindows?
834 break;
835 case TRAYCMD_CASCADE:
837 break;
838 case TRAYCMD_TILE_H:
840 break;
841 case TRAYCMD_TILE_V:
843 break;
846 break;
848 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
849 break;
850 case TRAYCMD_EJECT:
852 break;
855 break;
857 MinimizeAll();
858 break;
860 RestoreAll();
861 break;
863 ShowDesktop();
864 break;
867 break;
869 break;
872 {
875 }
876 break;
879 break;
883 break;
886 break;
890 break;
892 // TODO:
893 break;
895 UpdateWindow();
896 Sleep(100);
897 //DisconnectWindowsDialog(m_DesktopWnd); // FIXME: shell32
898 break;
904 break;
905 case IDM_SEARCH:
909 break;
913 break;
914 //case TRAYCMD_REFRESH_MENU: Does nothing on WinXP+
915 // break;
916 default:
917 break;
918 }
919
920 return FALSE;
921 }
#define IDM_SEARCH
Definition: resource.h:77
#define IDS_HELP_COMMAND
Definition: resource.h:109
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1116
BOOL UpdateWindow()
Definition: atlwin.h:1345
VOID ToggleDesktop()
Definition: traywnd.cpp:647
VOID ShowFolder(INT csidl, BOOL bExplore)
Definition: traywnd.cpp:751
HRESULT ExecResourceCmd(int id)
Definition: traywnd.cpp:432
static DWORD CALLBACK EjectThreadProc(LPVOID arg)
Definition: traywnd.cpp:808
VOID HideStartMenu()
Definition: traywnd.cpp:746
VOID MinimizeAll(BOOL bShowDesktop=FALSE)
Definition: traywnd.cpp:3221
LRESULT DoExitWindows()
Definition: traywnd.cpp:472
void DisplayRunFileDlg()
Definition: traywnd.cpp:543
BOOL WINAPI SHCreateThread(LPTHREAD_START_ROUTINE thread_proc, void *data, DWORD flags, LPTHREAD_START_ROUTINE callback)
Definition: main.c:1628
EXTERN_C int WINAPI LogoffWindowsDialog(HWND hWndOwner)
Definition: dialogs.cpp:1541
EXTERN_C BOOL WINAPI SHFindComputer(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch)
Definition: utils.cpp:1277
#define C_ASSERT(e)
Definition: intsafe.h:73
@ CTF_INSIST
Definition: shlwapi.h:71
#define BM_SETSTATE
Definition: winuser.h:1952
#define BM_CLICK
Definition: winuser.h:1946
BOOL WINAPI SHFindFiles(PCIDLIST_ABSOLUTE pidlFolder, PCIDLIST_ABSOLUTE pidlSaveFile)
Definition: shellord.c:2576
#define CSIDL_PRINTERS
Definition: shlobj.h:2195
@ REST_CLASSICSHELL
Definition: shlobj.h:1697
@ REST_NOSETFOLDERS
Definition: shlobj.h:1664
#define CSIDL_CONTROLS
Definition: shlobj.h:2194
#define FCIDM_SHBROWSER_FINDCOMPUTER
Definition: shlobj_undoc.h:97
#define FCIDM_SHBROWSER_REFRESH
Definition: shlobj_undoc.h:93
#define FCIDM_SHBROWSER_FINDFILES
Definition: shlobj_undoc.h:96
#define FCIDM_CABINET_REFRESH
Definition: shlobj_undoc.h:102
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:726
#define TRAYCMD_CONTROL_PANEL
Definition: undocshell.h:1013
#define TRAYCMD_STARTMENU
Definition: undocshell.h:995
#define TRAYCMD_LOCK_DESKTOP
Definition: undocshell.h:1016
#define TRAYCMD_REFRESH_MENU
Definition: undocshell.h:1021
#define TRAYCMD_DATE_AND_TIME
Definition: undocshell.h:1002
#define TRAYCMD_SEARCH_COMPUTERS
Definition: undocshell.h:1020
#define TRAYCMD_TASKBAR_PROPERTIES
Definition: undocshell.h:1005
#define TRAYCMD_SHOW_DESKTOP
Definition: undocshell.h:1008
#define TRAYCMD_TILE_V
Definition: undocshell.h:1000
#define TRAYCMD_SEARCH_FILES
Definition: undocshell.h:1019
#define TRAYCMD_CUSTOMIZE_TASKBAR
Definition: undocshell.h:1010
#define TRAYCMD_TILE_H
Definition: undocshell.h:999
#define TRAYCMD_EJECT
Definition: undocshell.h:1004
#define TRAYCMD_TOGGLE_DESKTOP
Definition: undocshell.h:1001
#define TRAYCMD_RUN_DIALOG
Definition: undocshell.h:996
#define TRAYCMD_LOGOFF_DIALOG
Definition: undocshell.h:997
#define TRAYCMD_CASCADE
Definition: undocshell.h:998
#define TRAYCMD_SHOW_TASK_MGR
Definition: undocshell.h:1009
#define TRAYCMD_RESTORE_ALL
Definition: undocshell.h:1007
#define TRAYCMD_SHUTDOWN_DIALOG
Definition: undocshell.h:1014
#define TRAYCMD_PRINTERS_AND_FAXES
Definition: undocshell.h:1015
#define TRAYCMD_RELOAD_STARTMENUCFG
Definition: undocshell.h:1018
#define TRAYCMD_MINIMIZE_ALL
Definition: undocshell.h:1006
#define TRAYCMD_SWITCH_USER_DIALOG
Definition: undocshell.h:1017
#define TRAYCMD_HELP_AND_SUPPORT
Definition: undocshell.h:1012

Referenced by ExecContextMenuCmd(), OnCommand(), and OnSettingChanged().

◆ HandleHotKey()

LRESULT CTrayWindow::HandleHotKey ( DWORD  id)
inline

Definition at line 765 of file traywnd.cpp.

766 {
767 switch (id)
768 {
769 case IDHK_RUN:
772 break;
773 case IDHK_HELP:
775 break;
776 case IDHK_EXPLORE:
778 break;
779 case IDHK_FIND:
781 break;
784 break;
786 ShellExecuteW(m_hWnd, NULL, L"sysdm.cpl", NULL, NULL, SW_NORMAL);
787 break;
788 case IDHK_NEXT_TASK:
789 break;
790 case IDHK_PREV_TASK:
791 break;
793 MinimizeAll();
794 break;
795 case IDHK_RESTORE_ALL:
796 RestoreAll();
797 break;
798 case IDHK_DESKTOP:
800 break;
801 case IDHK_PAGER:
802 break;
803 }
804
805 return 0;
806 }
#define CSIDL_DRIVES
Definition: shlobj.h:2207
#define IDHK_NEXT_TASK
Definition: traywnd.cpp:41
#define IDHK_RUN
Definition: traywnd.cpp:34
#define IDHK_DESKTOP
Definition: traywnd.cpp:44
#define IDHK_EXPLORE
Definition: traywnd.cpp:38
#define IDHK_MINIMIZE_ALL
Definition: traywnd.cpp:35
#define IDHK_RESTORE_ALL
Definition: traywnd.cpp:36
#define IDHK_SYS_PROPERTIES
Definition: traywnd.cpp:43
#define IDHK_PREV_TASK
Definition: traywnd.cpp:42
#define IDHK_FIND
Definition: traywnd.cpp:39
#define IDHK_HELP
Definition: traywnd.cpp:37
#define IDHK_FIND_COMPUTER
Definition: traywnd.cpp:40
#define IDHK_PAGER
Definition: traywnd.cpp:45

Referenced by OnHotkey().

◆ HideStartMenu()

VOID CTrayWindow::HideStartMenu ( )
inline

Definition at line 746 of file traywnd.cpp.

747 {
748 m_StartMenuPopup->OnSelect(MPOS_CANCELLEVEL);
749 }
CComPtr< IMenuPopup > m_StartMenuPopup
Definition: traywnd.cpp:323

Referenced by HandleCommand(), HandleHotKey(), OnOpenStartMenu(), and OnSettingChanged().

◆ if()

CTrayWindow::if ( m_StartMenuBand !  = NULL)
inline

Definition at line 3478 of file traywnd.cpp.

3479 {
3480 MSG Msg;
3481 LRESULT lRet;
3482
3483 Msg.hwnd = m_hWnd;
3484 Msg.message = uMsg;
3485 Msg.wParam = wParam;
3486 Msg.lParam = lParam;
3487
3488 if (m_StartMenuBand->TranslateMenuMessage(&Msg, &lRet) == S_OK)
3489 {
3490 return lRet;
3491 }
3492
3493 wParam = Msg.wParam;
3494 lParam = Msg.lParam;
3495 }
CComPtr< IMenuBand > m_StartMenuBand
Definition: traywnd.cpp:322
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
struct @1887 Msg[]
LONG_PTR LRESULT
Definition: minwindef.h:176
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829

◆ InvokeCommand()

HRESULT STDMETHODCALLTYPE CTrayWindow::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpici)
inline

Implements IContextMenu.

Definition at line 2336 of file traywnd.cpp.

2337 {
2338 if (!m_ContextMenu)
2339 return E_INVALIDARG;
2340
2341 return m_ContextMenu->InvokeCommand(lpici);
2342 }

◆ IsAlwaysOnTop()

BOOL CTrayWindow::IsAlwaysOnTop ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3689 of file traywnd.cpp.

DWORD AlwaysOnTop
Definition: precomp.h:208

◆ IsAutoHideState()

BOOL CTrayWindow::IsAutoHideState ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3687 of file traywnd.cpp.

3687{ return g_TaskbarSettings.sr.AutoHide; }
DWORD AutoHide
Definition: precomp.h:207

Referenced by ChangingWinPos(), OnCreate(), OnMouseMove(), and ResizeWorkArea().

◆ IsDialog()

static BOOL CTrayWindow::IsDialog ( HWND  hwnd)
inlinestatic

Definition at line 3186 of file traywnd.cpp.

3187 {
3188 WCHAR szClass[32];
3189 GetClassNameW(hwnd, szClass, _countof(szClass));
3190 return wcscmp(szClass, L"#32770") == 0;
3191 }
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by MinimizeWindowsProc().

◆ IsHidingState()

BOOL CTrayWindow::IsHidingState ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3688 of file traywnd.cpp.

3688{ return m_AutoHideState == AUTOHIDE_HIDING; }
#define AUTOHIDE_HIDING
Definition: traywnd.cpp:32

◆ IsHorizontal()

BOOL STDMETHODCALLTYPE CTrayWindow::IsHorizontal ( )
inline

Definition at line 2245 of file traywnd.cpp.

2246 {
2247 return IsPosHorizontal();
2248 }

◆ IsPointWithinShowDesktopButton()

BOOL CTrayWindow::IsPointWithinShowDesktopButton ( LPPOINT  ppt,
LPRECT  prcShowDesktopBtn,
PWINDOWINFO  pwi 
)
inline

Definition at line 2915 of file traywnd.cpp.

2916 {
2917 if (!ppt || !prcShowDesktopBtn)
2918 return FALSE;
2920
2921 switch (m_Position)
2922 {
2923 case ABE_LEFT:
2924 return !(ppt->x > prcShowDesktopBtn->right || ppt->y < prcShowDesktopBtn->top);
2925 case ABE_TOP:
2926 return !(ppt->x < prcShowDesktopBtn->left || ppt->y > prcShowDesktopBtn->bottom);
2927 case ABE_RIGHT:
2928 return !(ppt->x < prcShowDesktopBtn->left || ppt->y < prcShowDesktopBtn->top);
2929 case ABE_BOTTOM:
2930 return !(ppt->x < prcShowDesktopBtn->left || ppt->y < prcShowDesktopBtn->top);
2931 }
2932 return FALSE;
2933 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48

◆ IsPointWithinStartButton()

BOOL CTrayWindow::IsPointWithinStartButton ( LPPOINT  ppt,
LPRECT  prcStartBtn,
PWINDOWINFO  pwi 
)
inline

Definition at line 2872 of file traywnd.cpp.

2873 {
2874 if (!ppt || !prcStartBtn || !pwi)
2875 return FALSE;
2876
2877 switch (m_Position)
2878 {
2879 case ABE_TOP:
2880 case ABE_LEFT:
2881 {
2882 if (ppt->x > prcStartBtn->right || ppt->y > prcStartBtn->bottom)
2883 return FALSE;
2884 break;
2885 }
2886 case ABE_RIGHT:
2887 {
2888 if (ppt->x < prcStartBtn->left || ppt->y > prcStartBtn->bottom)
2889 return FALSE;
2890
2891 if (prcStartBtn->right + (int)pwi->cxWindowBorders * 2 + 1 < pwi->rcWindow.right &&
2892 ppt->x > prcStartBtn->right)
2893 {
2894 return FALSE;
2895 }
2896 break;
2897 }
2898 case ABE_BOTTOM:
2899 {
2900 if (ppt->x > prcStartBtn->right || ppt->y < prcStartBtn->top)
2901 return FALSE;
2902
2903 if (prcStartBtn->bottom + (int)pwi->cyWindowBorders * 2 + 1 < pwi->rcWindow.bottom &&
2904 ppt->y > prcStartBtn->bottom)
2905 {
2906 return FALSE;
2907 }
2908
2909 break;
2910 }
2911 }
2912 return TRUE;
2913 }
UINT cxWindowBorders
Definition: winuser.h:3880
UINT cyWindowBorders
Definition: winuser.h:3881
RECT rcWindow
Definition: winuser.h:3875

Referenced by OnNcLButtonDown().

◆ IsPosHorizontal()

BOOL CTrayWindow::IsPosHorizontal ( )
inline

Definition at line 1271 of file traywnd.cpp.

1272 {
1273 return m_Position == ABE_TOP || m_Position == ABE_BOTTOM;
1274 }

Referenced by AlignControls(), and IsHorizontal().

◆ IsSpecialHWND()

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

Definition at line 2239 of file traywnd.cpp.

2240 {
2241 return (m_hWnd == hWnd ||
2243 }
HWND hWnd
Definition: settings.c:17

Referenced by IsTaskWnd().

◆ IsTaskWnd()

BOOL STDMETHODCALLTYPE CTrayWindow::IsTaskWnd ( HWND  hWnd)
inline

Definition at line 2303 of file traywnd.cpp.

2304 {
2306 {
2308 if (((exStyle & WS_EX_APPWINDOW) || ::GetWindow(hWnd, GW_OWNER) == NULL) &&
2309 !(exStyle & WS_EX_TOOLWINDOW))
2310 {
2311 return TRUE;
2312 }
2313 }
2314 return FALSE;
2315 }
BOOL IsWindowVisible() const
Definition: atlwin.h:958
BOOL IsWindow() const
Definition: atlwin.h:947
BOOL STDMETHODCALLTYPE IsSpecialHWND(IN HWND hWnd)
Definition: traywnd.cpp:2239
#define GW_OWNER
Definition: winuser.h:777
#define WS_EX_APPWINDOW
Definition: winuser.h:383
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define GWL_EXSTYLE
Definition: winuser.h:862
#define GetWindowLongPtr
Definition: treelist.c:73

◆ Lock()

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

Definition at line 2250 of file traywnd.cpp.

2251 {
2252 BOOL bPrevLock = g_TaskbarSettings.bLock;
2253
2254 if (g_TaskbarSettings.bLock != bLock)
2255 {
2256 g_TaskbarSettings.bLock = bLock;
2257
2258 if (m_TrayBandSite != NULL)
2259 {
2260 if (!SUCCEEDED(m_TrayBandSite->Lock(bLock)))
2261 {
2262 /* Reset?? */
2263 g_TaskbarSettings.bLock = bPrevLock;
2264 return bPrevLock;
2265 }
2266 }
2267
2268 if (m_Theme)
2269 {
2270 /* Update cached tray sizes */
2271 for(DWORD Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++)
2272 {
2273 RECT rcGripper = {0};
2274 AdjustSizerRect(&rcGripper, Pos);
2275
2277 {
2278 m_TrayRects[Pos].top += rcGripper.top;
2279 m_TrayRects[Pos].left += rcGripper.left;
2280 m_TrayRects[Pos].bottom += rcGripper.bottom;
2281 m_TrayRects[Pos].right += rcGripper.right;
2282 }
2283 else
2284 {
2285 m_TrayRects[Pos].top -= rcGripper.top;
2286 m_TrayRects[Pos].left -= rcGripper.left;
2287 m_TrayRects[Pos].bottom -= rcGripper.bottom;
2288 m_TrayRects[Pos].right -= rcGripper.right;
2289 }
2290 }
2291 }
2295 }
2296
2297 return bPrevLock;
2298 }
VOID AdjustSizerRect(RECT *rc, DWORD pos)
Definition: traywnd.cpp:1196
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define SWP_FRAMECHANGED
Definition: winuser.h:1251
#define SWP_NOOWNERZORDER
Definition: winuser.h:1260

◆ MakeTrayRectWithSize()

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

Definition at line 1225 of file traywnd.cpp.

1228 {
1229 switch (Position)
1230 {
1231 case ABE_LEFT:
1232 pRect->right = pRect->left + pTraySize->cx;
1233 break;
1234
1235 case ABE_TOP:
1236 pRect->bottom = pRect->top + pTraySize->cy;
1237 break;
1238
1239 case ABE_RIGHT:
1240 pRect->left = pRect->right - pTraySize->cx;
1241 break;
1242
1243 case ABE_BOTTOM:
1244 default:
1245 pRect->top = pRect->bottom - pTraySize->cy;
1246 break;
1247 }
1248 }

Referenced by ChangingWinPos(), and GetTrayRectFromScreenRect().

◆ MinimizeAll()

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

Definition at line 3221 of file traywnd.cpp.

3222 {
3223 MINIMIZE_INFO info;
3224 info.hwndDesktop = GetDesktopWindow();;
3225 info.hTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL);
3226 info.hwndProgman = FindWindowW(L"Progman", NULL);
3227 info.pMinimizedAll = &g_MinimizedAll;
3228 info.bShowDesktop = bShowDesktop;
3230
3233 }
HWND SetFocus()
Definition: atlwin.h:1198
static BOOL CALLBACK MinimizeWindowsProc(HWND hwnd, LPARAM lParam)
Definition: traywnd.cpp:3193
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
CSimpleArray< MINWNDPOS > g_MinimizedAll
Definition: traywnd.cpp:174

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

◆ MinimizeWindowsProc()

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

Definition at line 3193 of file traywnd.cpp.

3194 {
3195 MINIMIZE_INFO *info = (MINIMIZE_INFO *)lParam;
3196 if (hwnd == info->hwndDesktop || hwnd == info->hTrayWnd || hwnd == info->hwndProgman)
3197 return TRUE; // Ignore special windows
3198
3199 if (!info->bShowDesktop)
3200 {
3202 return TRUE;
3203 HWND hwndOwner = ::GetWindow(hwnd, GW_OWNER);
3204 if (hwndOwner && !::IsWindowEnabled(hwndOwner))
3205 return TRUE;
3206 }
3207
3208 if (CanBeMinimized(hwnd))
3209 {
3210 MINWNDPOS mwp = { hwnd, { sizeof(mwp.wndpl) } };
3211 if (::GetWindowPlacement(hwnd, &mwp.wndpl) && // Save the position and status
3213 {
3214 info->pMinimizedAll->Add(mwp);
3215 }
3216 }
3217
3218 return TRUE;
3219 }
BOOL IsWindowEnabled() const
Definition: atlwin.h:952
static BOOL IsDialog(HWND hwnd)
Definition: traywnd.cpp:3186
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
BOOL WINAPI ShowWindowAsync(_In_ HWND, _In_ int)
#define SW_SHOWMINNOACTIVE
Definition: winuser.h:788
WINDOWPLACEMENT wndpl
Definition: traywnd.cpp:172
BOOL CanBeMinimized(HWND hwnd)
Definition: traywnd.cpp:90

Referenced by MinimizeAll().

◆ NotifyFullScreenToAppBars()

STDMETHODIMP CTrayWindow::NotifyFullScreenToAppBars ( HMONITOR  hMonitor,
BOOL  bFullOpening 
)
inlineoverride

Definition at line 3159 of file traywnd.cpp.

3160 {
3161 OnAppBarNotifyAll(hMonitor, NULL, ABN_FULLSCREENAPP, bFullOpening);
3162 return S_OK;
3163 }
#define ABN_FULLSCREENAPP
Definition: shellapi.h:74

◆ OnActivate()

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

Definition at line 3372 of file traywnd.cpp.

3373 {
3375 if (!wParam) // !(Activate || Minimized)
3376 {
3377 SendMessage(WM_CHANGEUISTATE, MAKELONG(UIS_SET, UISF_HIDEACCEL | UISF_HIDEFOCUS), 0);
3379 }
3380 return 0;
3381 }
void OnAppBarActivationChange2(_In_ HWND hwndNewAutoHide, _In_ UINT uSide)
Definition: appbar.cpp:475
HRESULT WINAPI IUnknown_UIActivateIO(IUnknown *unknown, BOOL activate, LPMSG msg)
Definition: ordinal.c:1228
#define MAKELONG(a, b)
Definition: typedefs.h:249

◆ OnAppTrayDestroy()

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

Definition at line 3104 of file traywnd.cpp.

3105 {
3106 DestroyWindow();
3107 return TRUE;
3108 }
BOOL DestroyWindow()
Definition: atlwin.h:462

◆ OnCommand()

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

Definition at line 3252 of file traywnd.cpp.

3253 {
3254 LRESULT Ret = FALSE;
3255
3257 {
3258 return FALSE;
3259 }
3260
3261 if (m_TrayBandSite == NULL || FAILED_UNEXPECTEDLY(m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret)))
3262 {
3263 return HandleCommand(LOWORD(wParam));
3264 }
3265 return Ret;
3266 }
#define LOWORD(l)
Definition: pedump.c:82

◆ OnContextMenu()

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

Definition at line 2973 of file traywnd.cpp.

2974 {
2975 LRESULT Ret = FALSE;
2976 POINT pt, *ppt = NULL;
2977 HWND hWndExclude = NULL;
2978
2979 /* Check if the administrator has forbidden access to context menus */
2981 return FALSE;
2982
2983 pt.x = (SHORT) LOWORD(lParam);
2984 pt.y = (SHORT) HIWORD(lParam);
2985
2986 if (pt.x != -1 || pt.y != -1)
2987 ppt = &pt;
2988 else
2989 hWndExclude = m_StartButton.m_hWnd;
2990
2992 {
2993 /* Make sure we can't track the context menu if the start
2994 menu is currently being shown */
2996 {
2997 CComPtr<IContextMenu> ctxMenu;
2999 TrackCtxMenu(ctxMenu, ppt, hWndExclude, m_Position == ABE_BOTTOM, this);
3000 }
3001 }
3002 else
3003 {
3004 /* See if the context menu should be handled by the task band site */
3005 if (ppt != NULL && m_TrayBandSite != NULL)
3006 {
3007 HWND hWndAtPt;
3008 POINT ptClient = *ppt;
3009
3010 /* Convert the coordinates to client-coordinates */
3011 ::MapWindowPoints(NULL, m_hWnd, &ptClient, 1);
3012
3013 hWndAtPt = ChildWindowFromPoint(ptClient);
3014 if (hWndAtPt != NULL &&
3015 (hWndAtPt == m_Rebar || ::IsChild(m_Rebar, hWndAtPt)))
3016 {
3017 /* Check if the user clicked on the task switch window */
3018 ptClient = *ppt;
3019 ::MapWindowPoints(NULL, m_Rebar, &ptClient, 1);
3020
3022 if (hWndAtPt == m_TaskSwitch)
3023 goto HandleTrayContextMenu;
3024
3025 /* Forward the message to the task band site */
3026 m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret);
3027 }
3028 else
3029 goto HandleTrayContextMenu;
3030 }
3031 else
3032 {
3033HandleTrayContextMenu:
3034 /* Tray the default tray window context menu */
3035 TrackCtxMenu(this, ppt, NULL, FALSE, this);
3036 }
3037 }
3038 return Ret;
3039 }
HRESULT CStartMenuBtnCtxMenu_CreateInstance(ITrayWindow *TrayWnd, IN HWND hWndOwner, IContextMenu **ppCtxMenu)
HRESULT TrackCtxMenu(IN IContextMenu *contextMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN PVOID Context OPTIONAL)
Definition: traywnd.cpp:995
short SHORT
Definition: pedump.c:59
HWND WINAPI ChildWindowFromPoint(_In_ HWND, _In_ POINT)
#define BM_GETSTATE
Definition: winuser.h:1949
HWND WINAPI ChildWindowFromPointEx(_In_ HWND, _In_ POINT, _In_ UINT)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define CWP_SKIPDISABLED
Definition: winuser.h:209
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)
#define BST_PUSHED
Definition: winuser.h:201
#define CWP_SKIPINVISIBLE
Definition: winuser.h:208
@ REST_NOTRAYCONTEXTMENU
Definition: shlobj.h:1685

Referenced by OnNcRButtonUp().

◆ OnCopyData()

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

Definition at line 2607 of file traywnd.cpp.

2608 {
2610 if (!pCopyData)
2611 return FALSE;
2612
2613 switch (pCopyData->dwData)
2614 {
2615 case TABDMC_APPBAR:
2616 return OnAppBarMessage(pCopyData);
2617 case TABDMC_NOTIFY:
2618 case TABDMC_LOADINPROC:
2619 return ::SendMessageW(m_TrayNotify, uMsg, wParam, lParam);
2620 }
2621 return FALSE;
2622 }
LRESULT OnAppBarMessage(_Inout_ PCOPYDATASTRUCT pCopyData)
Definition: appbar.cpp:571
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT
ULONG_PTR dwData
Definition: winuser.h:3109
#define TABDMC_APPBAR
Definition: undocshell.h:1024
#define TABDMC_LOADINPROC
Definition: undocshell.h:1026
#define TABDMC_NOTIFY
Definition: undocshell.h:1025

◆ OnCreate()

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

Definition at line 2360 of file traywnd.cpp.

2361 {
2362 HRESULT hRet;
2363
2364 ((ITrayWindow*)this)->AddRef();
2365
2366 SetWindowTheme(m_hWnd, L"TaskBar", NULL);
2367
2368 /* Create the Start button */
2370
2371 /* Load the saved tray window settings */
2373
2374 /* Create and initialize the start menu */
2378
2379 /* Create the task band */
2381 if (FAILED_UNEXPECTEDLY(hRet))
2382 return FALSE;
2383
2384 /* Create the rebar band site. This actually creates the rebar and the tasks toolbar. */
2386 if (FAILED_UNEXPECTEDLY(hRet))
2387 return FALSE;
2388
2389 /* Create the tray notification window */
2391 if (FAILED_UNEXPECTEDLY(hRet))
2392 return FALSE;
2393
2394 /* Get the hwnd of the rebar */
2396 if (FAILED_UNEXPECTEDLY(hRet))
2397 return FALSE;
2398
2399 /* Get the hwnd of the tasks toolbar */
2401 if (FAILED_UNEXPECTEDLY(hRet))
2402 return FALSE;
2403
2404 /* Get the hwnd of the tray notification window */
2406 if (FAILED_UNEXPECTEDLY(hRet))
2407 return FALSE;
2408
2411 return FALSE;
2412
2413 SetWindowTheme(m_Rebar, L"TaskBar", NULL);
2414
2415 UpdateFonts();
2416
2418
2419 if (IsAutoHideState())
2420 {
2423 }
2424
2425 /* Set the initial lock state in the band site */
2427
2428 static const UINT winkeys[] =
2429 {
2442
2453
2464
2475
2486
2497 };
2499 {
2500 for (UINT i = 0; i < _countof(winkeys); ++i)
2501 {
2502 UINT mod = HIBYTE(HIWORD(winkeys[i])), key = LOBYTE(HIWORD(winkeys[i]));
2503 RegisterHotKey(m_hWnd, LOWORD(winkeys[i]), mod, key);
2504 }
2505 }
2506
2507 m_WinMMDevChgMsg = RegisterWindowMessageW(L"winmm_devicechange");
2508
2509 return TRUE;
2510 }
#define IID_PPV_ARG(Itype, ppType)
std::map< E_MODULE, HMODULE > mod
Definition: LocaleTests.cpp:68
IMenuPopup * CreateStartMenu(IN ITrayWindow *Tray, OUT IMenuBand **ppMenuBand, IN HBITMAP hbmBanner OPTIONAL, IN BOOL bSmallIcons)
Definition: startmnu.cpp:51
HRESULT CTrayNotifyWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
Definition: trayntfy.cpp:555
HRESULT CTrayBandSite_CreateInstance(IN ITrayWindow *tray, IN IDeskBand *pTaskBand, OUT ITrayBandSite **pBandSite)
Definition: tbsite.cpp:728
#define TNWM_GETSHOWDESKTOPBUTTON
Definition: precomp.h:382
HRESULT InitShellServices(HDPA *phdpa)
HRESULT CTaskBand_CreateInstance(IN ITrayWindow *Tray, HWND hWndStartButton, REFIID riid, void **ppv)
Definition: taskband.cpp:348
#define IDB_STARTMENU
Definition: resource.h:44
HWND Create(HWND hwndParent)
Definition: traywnd.cpp:264
CComPtr< IDeskBand > m_TaskBand
Definition: traywnd.cpp:325
VOID RegLoadSettings()
Definition: traywnd.cpp:1657
CComPtr< IUnknown > m_TrayNotifyInstance
Definition: traywnd.cpp:336
void UpdateFonts()
Definition: traywnd.cpp:1075
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:988
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
unsigned int UINT
Definition: sysinfo.c:13
#define MOD_ALT
Definition: imm.h:184
#define MOD_SHIFT
Definition: imm.h:186
#define MOD_CONTROL
Definition: imm.h:185
ULONG AddRef()
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
static HBITMAP
Definition: button.c:44
#define VK_TAB
Definition: winuser.h:2235
#define MOD_WIN
Definition: winuser.h:2686
#define VK_F1
Definition: winuser.h:2291
#define VK_PAUSE
Definition: winuser.h:2241
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
BOOL WINAPI RegisterHotKey(_In_opt_ HWND, _In_ int, _In_ UINT, _In_ UINT)
UINT WINAPI RegisterWindowMessageW(_In_ LPCWSTR)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2532
@ REST_NOWINKEYS
Definition: shlobj.h:1758
DWORD SmSmallIcons
Definition: precomp.h:209
Definition: copy.c:22
#define AUTOHIDE_DELAY_HIDE
Definition: traywnd.cpp:22
#define TIMER_ID_AUTOHIDE
Definition: traywnd.cpp:19
#define IDHK_ACTIVATE_TASK
Definition: traywnd.cpp:47
#define MAKEWORD(a, b)
Definition: typedefs.h:248
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69

◆ OnCtlColorBtn()

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

Definition at line 2648 of file traywnd.cpp.

2649 {
2652 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define TRANSPARENT
Definition: wingdi.h:950
#define HOLLOW_BRUSH
Definition: wingdi.h:899
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056

◆ OnDestroy()

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

Definition at line 2512 of file traywnd.cpp.

2513 {
2514 return 0;
2515 }

◆ OnDisplayChange()

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

Definition at line 2593 of file traywnd.cpp.

2594 {
2595 /* Refresh workareas */
2597
2598 /* Load the saved tray window settings */
2600
2601 /* Move the tray window to the right position and resize it if necessary */
2603
2604 return TRUE;
2605 }
void RecomputeAllWorkareas()
Definition: appbar.cpp:449
VOID CheckTrayWndPosition()
Definition: traywnd.cpp:1635

◆ OnDoExitWindows()

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

Definition at line 3125 of file traywnd.cpp.

3126 {
3127 /*
3128 * TWM_DOEXITWINDOWS is send by the CDesktopBrowser to us
3129 * to show the shutdown dialog. Also a WM_CLOSE message sent
3130 * by apps should show the dialog.
3131 */
3132 return DoExitWindows();
3133 }

◆ OnEndSession()

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

Definition at line 2517 of file traywnd.cpp.

2518 {
2519 if (wParam)
2520 SaveState();
2521 return 0;
2522 }

◆ OnEnterSizeMove()

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

Definition at line 2783 of file traywnd.cpp.

2784 {
2785 InSizeMove = TRUE;
2786 IsDragging = FALSE;
2788 {
2789 /* Remove the clipping on multi monitor systems while dragging around */
2791 }
2793 return TRUE;
2794 }

◆ OnEraseBackground()

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

Definition at line 2580 of file traywnd.cpp.

2581 {
2582 HDC hdc = (HDC) wParam;
2583
2584 if (!m_Theme)
2585 {
2586 bHandled = FALSE;
2587 return 0;
2588 }
2589
2591 }
LRESULT EraseBackgroundWithTheme(HDC hdc)
Definition: traywnd.cpp:2124

◆ OnExitSizeMove()

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

Definition at line 2796 of file traywnd.cpp.

2797 {
2798 InSizeMove = FALSE;
2800 {
2802
2803 /* Apply clipping */
2805 }
2806 return TRUE;
2807 }
#define WM_SIZE
Definition: winuser.h:1639
#define SIZE_RESTORED
Definition: winuser.h:2541

◆ OnGetMinMaxInfo()

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

Definition at line 3391 of file traywnd.cpp.

3392 {
3394 SIZE StartSize = m_StartButton.GetSize();
3395 pInfo->ptMinTrackSize.x = StartSize.cx + 2 * GetSystemMetrics(SM_CXFRAME);
3396 pInfo->ptMinTrackSize.y = StartSize.cy + 2 * GetSystemMetrics(SM_CYFRAME);
3397 return 0;
3398 }
#define SM_CXFRAME
Definition: winuser.h:1005
#define SM_CYFRAME
Definition: winuser.h:1007
struct tagMINMAXINFO * PMINMAXINFO
POINT ptMinTrackSize
Definition: winuser.h:3738

◆ OnGetTaskSwitch()

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

Definition at line 3146 of file traywnd.cpp.

3147 {
3148 bHandled = TRUE;
3149 return (LRESULT)m_TaskSwitch;
3150 }

◆ OnHotkey()

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

Definition at line 3165 of file traywnd.cpp.

3166 {
3168 {
3169 // Map the ('1'-'9','0') hotkey to a zero-based task index
3170 DWORD iTask = (HIWORD(lParam) - '0' + 9) % 10;
3171 // Request the task switcher to perform the switch
3173 }
3174 return HandleHotKey(wParam);
3175 }
#define TSWM_ACTIVATETASKINDEX
Definition: precomp.h:398
LRESULT HandleHotKey(DWORD id)
Definition: traywnd.cpp:765
#define MAKEWPARAM(l, h)
Definition: winuser.h:4117

◆ OnInitMenuPopup()

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

Definition at line 3335 of file traywnd.cpp.

3336 {
3337 HMENU hMenu = (HMENU)wParam;
3339 {
3343 if (g_Arrangement != NONE)
3344 {
3347 MENUITEMINFOW mii = { sizeof(mii) };
3349 mii.fMask = MIIM_TYPE;
3350 mii.fType = MFT_STRING;
3351 mii.dwTypeData = const_cast<LPWSTR>(&strCaption[0]);
3353 }
3354 else
3355 {
3357 }
3358 }
3359 else
3360 {
3366 g_WindowPosBackup.RemoveAll();
3367 }
3368 return 0;
3369 }
#define IDS_TRAYWND_UNDO_TILE
Definition: resource.h:113
#define IDS_TRAYWND_UNDO_CASCADE
Definition: resource.h:112
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL WINAPI SetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_ENABLED
Definition: winuser.h:128
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
#define MFT_STRING
Definition: winuser.h:757
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MIIM_TYPE
Definition: winuser.h:736
#define MF_GRAYED
Definition: winuser.h:129
LPWSTR dwTypeData
Definition: winuser.h:3377
CSimpleArray< WINDOWPOSBACKUPDATA > g_WindowPosBackup
Definition: traywnd.cpp:56
static BOOL IsThereAnyEffectiveWindow(BOOL bMustBeInMonitor)
Definition: traywnd.cpp:155
uint16_t * LPWSTR
Definition: typedefs.h:56

◆ OnLButtonUp()

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

Definition at line 3097 of file traywnd.cpp.

3098 {
3100 m_pShowDesktopButton->OnLButtonUp(uMsg, wParam, lParam, bHandled);
3101 return FALSE;
3102 }
LRESULT OnLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)

◆ OnMouseMove()

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

Definition at line 3268 of file traywnd.cpp.

3269 {
3271
3272 if (IsAutoHideState())
3273 {
3275 }
3276
3277 return TRUE;
3278 }
#define TIMER_ID_MOUSETRACK
Definition: traywnd.cpp:20
#define MOUSETRACK_INTERVAL
Definition: traywnd.cpp:21

◆ OnMoving()

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

Definition at line 2714 of file traywnd.cpp.

2715 {
2716 POINT ptCursor;
2717 PRECT pRect = (PRECT) lParam;
2718
2719 /* We need to ensure that an application can not accidently
2720 move the tray window (using SetWindowPos). However, we still
2721 need to be able to move the window in case the user wants to
2722 drag the tray window to another position or in case the user
2723 wants to resize the tray window. */
2724 if (!g_TaskbarSettings.bLock && GetCursorPos(&ptCursor))
2725 {
2726 IsDragging = TRUE;
2728 }
2729 else
2730 {
2731 *pRect = m_TrayRects[m_Position];
2732 }
2733 return TRUE;
2734 }
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3074
#define PRECT
Definition: precomp.h:27

◆ OnNcActivate()

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

Definition at line 3298 of file traywnd.cpp.

3299 {
3301 DrawShowDesktopButton(); // We have to draw non-client area
3302 bHandled = TRUE;
3303 return ret;
3304 }
void DrawShowDesktopButton()
Definition: traywnd.cpp:2625
return ret
Definition: mutex.c:147
#define DefWindowProc
Definition: ros2win.h:31

◆ OnNcCalcSize()

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

Definition at line 3306 of file traywnd.cpp.

3307 {
3308 RECT *rc = NULL;
3309 /* Ignore WM_NCCALCSIZE if we are not themed or locked */
3311 {
3312 bHandled = FALSE;
3313 return 0;
3314 }
3315 if(!wParam)
3316 {
3317 rc = (RECT*)wParam;
3318 }
3319 else
3320 {
3322 if(prms->lppos->flags & SWP_NOSENDCHANGING)
3323 {
3324 bHandled = FALSE;
3325 return 0;
3326 }
3327 rc = &prms->rgrc[0];
3328 }
3329
3331
3332 return 0;
3333 }
#define SWP_NOSENDCHANGING
Definition: winuser.h:1262
UINT flags
Definition: winuser.h:3702
PWINDOWPOS lppos
Definition: winuser.h:3707

◆ OnNcHitTest()

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

Definition at line 2659 of file traywnd.cpp.

2660 {
2661 RECT rcClient;
2662 POINT pt;
2663
2665 {
2666 /* The user may not be able to resize the tray window.
2667 Pretend like the window is not sizeable when the user
2668 clicks on the border. */
2669 return HTBORDER;
2670 }
2671
2673 if (GetClientRect(&rcClient) &&
2674 (MapWindowPoints(NULL, (LPPOINT) &rcClient, 2) != 0 || GetLastError() == ERROR_SUCCESS))
2675 {
2676 pt.x = GET_X_LPARAM(lParam);
2677 pt.y = GET_Y_LPARAM(lParam);
2678
2680 return HTBORDER;
2681
2682 if (PtInRect(&rcClient, pt))
2683 {
2684 /* The user is trying to drag the tray window */
2685 return HTCAPTION;
2686 }
2687
2688 /* Depending on the position of the tray window, allow only
2689 changing the border next to the monitor working area */
2690 switch (m_Position)
2691 {
2692 case ABE_TOP:
2693 if (pt.y > rcClient.bottom)
2694 return HTBOTTOM;
2695 break;
2696 case ABE_LEFT:
2697 if (pt.x > rcClient.right)
2698 return HTRIGHT;
2699 break;
2700 case ABE_RIGHT:
2701 if (pt.x < rcClient.left)
2702 return HTLEFT;
2703 break;
2704 case ABE_BOTTOM:
2705 default:
2706 if (pt.y < rcClient.top)
2707 return HTTOP;
2708 break;
2709 }
2710 }
2711 return HTBORDER;
2712 }
BOOL PtInButton(LPPOINT pt) const
#define ERROR_SUCCESS
Definition: deptool.c:10
#define SetLastError(x)
Definition: compat.h:752
#define HTCAPTION
Definition: winuser.h:2512
#define HTBOTTOM
Definition: winuser.h:2529
#define HTBORDER
Definition: winuser.h:2533
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define HTRIGHT
Definition: winuser.h:2525
#define HTTOP
Definition: winuser.h:2526
#define HTLEFT
Definition: winuser.h:2523
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299

◆ OnNcLButtonDblClick()

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

Definition at line 3075 of file traywnd.cpp.

3076 {
3077 /* Let the clock handle the double-click */
3079
3080 /* We "handle" this message so users can't cause a weird maximize/restore
3081 window animation when double-clicking the tray window! */
3082 return TRUE;
3083 }

◆ OnNcLButtonDown()

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

This handler implements the trick that makes the start button to get pressed when the user clicked left or below the button.

Definition at line 2939 of file traywnd.cpp.

2940 {
2942 WINDOWINFO wi = {sizeof(WINDOWINFO)};
2943
2944 bHandled = FALSE;
2945
2946 RECT rcStartBtn;
2947 m_StartButton.GetWindowRect(&rcStartBtn);
2948 GetWindowInfo(m_hWnd, &wi);
2949
2950 if (IsPointWithinStartButton(&pt, &rcStartBtn, &wi))
2951 {
2952 bHandled = TRUE;
2954 return 0;
2955 }
2956
2959
2960 return 0;
2961 }
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:816
LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
void PopupStartMenu()
Definition: traywnd.cpp:1921
BOOL IsPointWithinStartButton(LPPOINT ppt, LPRECT prcStartBtn, PWINDOWINFO pwi)
Definition: traywnd.cpp:2872
BOOL WINAPI GetWindowInfo(_In_ HWND, _Inout_ PWINDOWINFO)
struct tagWINDOWINFO WINDOWINFO
#define WM_LBUTTONDOWN
Definition: winuser.h:1804

◆ OnNcLButtonUp()

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

Definition at line 3085 of file traywnd.cpp.

3086 {
3087 if (m_pShowDesktopButton && m_pShowDesktopButton->m_bPressed) // Did you click the button?
3088 {
3091 bHandled = TRUE;
3092 }
3093
3094 return FALSE;
3095 }
#define WM_LBUTTONUP
Definition: winuser.h:1805

◆ OnNcPaint()

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

Definition at line 2632 of file traywnd.cpp.

2633 {
2634 DefWindowProc(uMsg, wParam, lParam);
2635 bHandled = TRUE;
2636
2638 {
2639 DrawShowDesktopButton(); // We have to draw non-client area
2640 return 0;
2641 }
2642
2643 DrawSizerWithTheme((HRGN) wParam);
2644 DrawShowDesktopButton(); // We have to draw non-client area
2645 return 0;
2646 }
int DrawSizerWithTheme(IN HRGN hRgn)
Definition: traywnd.cpp:2140

◆ OnNcRButtonUp()

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

Definition at line 2963 of file traywnd.cpp.

2964 {
2965 /* We want the user to be able to get a context menu even on the nonclient
2966 area (including the sizing border)! */
2967 uMsg = WM_CONTEXTMENU;
2968 wParam = (WPARAM) m_hWnd;
2969
2970 return OnContextMenu(uMsg, wParam, lParam, bHandled);
2971 }
LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2973
#define WM_CONTEXTMENU
Definition: richedit.h:64

◆ OnNotify()

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

Definition at line 3041 of file traywnd.cpp.

3042 {
3043 LRESULT Ret = FALSE;
3044 /* FIXME: We can't check with IsChild whether the hwnd is somewhere inside
3045 the rebar control! But we shouldn't forward messages that the band
3046 site doesn't handle, such as other controls (start button, tray window) */
3047
3048 HRESULT hr = E_FAIL;
3049
3050 if (m_TrayBandSite)
3051 {
3052 hr = m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret);
3053 if (SUCCEEDED(hr))
3054 return Ret;
3055 }
3056
3057 if (m_TrayBandSite == NULL || FAILED(hr))
3058 {
3059 const NMHDR *nmh = (const NMHDR *) lParam;
3060
3061 if (nmh->hwndFrom == m_TrayNotify)
3062 {
3063 switch (nmh->code)
3064 {
3065 case NTNWM_REALIGN:
3066 /* Cause all controls to be aligned */
3068 break;
3069 }
3070 }
3071 }
3072 return Ret;
3073 }
#define NTNWM_REALIGN
Definition: precomp.h:384
#define FAILED(hr)
Definition: intsafe.h:51
UINT code
Definition: winuser.h:3267
HWND hwndFrom
Definition: winuser.h:3265

◆ OnOpenStartMenu()

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

Definition at line 3110 of file traywnd.cpp.

3111 {
3112 HWND hwndStartMenu;
3113 HRESULT hr = IUnknown_GetWindow(m_StartMenuPopup, &hwndStartMenu);
3115 return FALSE;
3116
3117 if (::IsWindowVisible(hwndStartMenu))
3118 HideStartMenu();
3119 else
3121
3122 return TRUE;
3123 }

◆ OnRebarAutoSize()

LRESULT CTrayWindow::OnRebarAutoSize ( INT  code,
LPNMHDR  nmhdr,
BOOL &  bHandled 
)
inline

Definition at line 3400 of file traywnd.cpp.

3401 {
3402#if 0
3403 LPNMRBAUTOSIZE as = (LPNMRBAUTOSIZE) nmhdr;
3404
3405 if (!as->fChanged)
3406 return 0;
3407
3408 RECT rc;
3409 ::GetWindowRect(m_hWnd, &rc);
3410
3411 SIZE szWindow = {
3412 rc.right - rc.left,
3413 rc.bottom - rc.top };
3414 SIZE szTarget = {
3415 as->rcTarget.right - as->rcTarget.left,
3416 as->rcTarget.bottom - as->rcTarget.top };
3417 SIZE szActual = {
3418 as->rcActual.right - as->rcActual.left,
3419 as->rcActual.bottom - as->rcActual.top };
3420
3421 SIZE borders = {
3422 szWindow.cx - szTarget.cx,
3423 szWindow.cy - szTarget.cx,
3424 };
3425
3426 switch (m_Position)
3427 {
3428 case ABE_LEFT:
3429 szWindow.cx = szActual.cx + borders.cx;
3430 break;
3431 case ABE_TOP:
3432 szWindow.cy = szActual.cy + borders.cy;
3433 break;
3434 case ABE_RIGHT:
3435 szWindow.cx = szActual.cx + borders.cx;
3436 rc.left = rc.right - szWindow.cy;
3437 break;
3438 case ABE_BOTTOM:
3439 szWindow.cy = szActual.cy + borders.cy;
3440 rc.top = rc.bottom - szWindow.cy;
3441 break;
3442 }
3443
3444 SetWindowPos(NULL, rc.left, rc.top, szWindow.cx, szWindow.cy, SWP_NOACTIVATE | SWP_NOZORDER);
3445#else
3446 bHandled = FALSE;
3447#endif
3448 return 0;
3449 }
struct tagNMRBAUTOSIZE * LPNMRBAUTOSIZE

◆ OnSetFocus()

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

Definition at line 3384 of file traywnd.cpp.

3385 {
3387 return 0;
3388 }

◆ OnSettingChanged()

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

Definition at line 2544 of file traywnd.cpp.

2545 {
2546 if (wParam == SPI_SETNONCLIENTMETRICS)
2547 {
2550 UpdateFonts();
2553 }
2554
2555 // Note: We rely on CDesktopBrowser to get this message and call SHSettingsChanged
2556 if (m_DesktopWnd)
2558
2559 if (m_StartMenuPopup && lstrcmpiW((LPCWSTR)lParam, L"TraySettings") == 0)
2560 {
2561 HideStartMenu();
2562
2564#if 1 // FIXME: Please re-use the start menu
2565 /* Re-create the start menu */
2569 FIXME("Use UpdateStartMenu\n");
2570#else
2571 // Update the start menu
2574#endif
2575 }
2576
2577 return 0;
2578 }
#define FIXME(fmt,...)
Definition: precomp.h:53
HRESULT UpdateStartMenu(IN OUT IMenuPopup *pMenuPopup, IN HBITMAP hbmBanner OPTIONAL, IN BOOL bSmallIcons, IN BOOL bRefresh)
Definition: startmnu.cpp:24
void Release()
Definition: atlcomcli.h:170
VOID AlignControls(IN PRECT prcClient OPTIONAL)
Definition: traywnd.cpp:1735
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4171
const uint16_t * LPCWSTR
Definition: typedefs.h:57

◆ OnSetZOrder()

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

Definition at line 3153 of file traywnd.cpp.

3154 {
3155 return ::SetWindowPos(m_hWnd, (HWND)wParam, 0, 0, 0, 0,
3157 }

◆ OnSize()

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

Definition at line 2757 of file traywnd.cpp.

2758 {
2759 RECT rcClient;
2760 if (wParam == SIZE_RESTORED && lParam == 0)
2761 {
2763 /* Clip the tray window on multi monitor systems so the edges can't
2764 overlap into another monitor */
2766
2767 if (!GetClientRect(&rcClient))
2768 {
2769 return FALSE;
2770 }
2771 }
2772 else
2773 {
2774 rcClient.left = rcClient.top = 0;
2775 rcClient.right = LOWORD(lParam);
2776 rcClient.bottom = HIWORD(lParam);
2777 }
2778
2779 AlignControls(&rcClient);
2780 return TRUE;
2781 }

◆ OnSizing()

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

Definition at line 2736 of file traywnd.cpp.

2737 {
2738 PRECT pRect = (PRECT) lParam;
2739
2741 {
2742 FitToRebar(pRect);
2743 }
2744 else
2745 {
2746 *pRect = m_TrayRects[m_Position];
2747 }
2748 return TRUE;
2749 }

◆ OnSysChar()

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

Definition at line 2809 of file traywnd.cpp.

2810 {
2811 switch (wParam)
2812 {
2813 case TEXT(' '):
2814 {
2815 /* The user pressed Alt+Space, this usually brings up the system menu of a window.
2816 The tray window needs to handle this specially, since it normally doesn't have
2817 a system menu. */
2818
2819 static const UINT uidDisableItem [] = {
2820 SC_RESTORE,
2821 SC_MOVE,
2822 SC_SIZE,
2825 };
2826 HMENU hSysMenu;
2827 UINT i, uId;
2828
2829 /* temporarily enable the system menu */
2831
2832 hSysMenu = GetSystemMenu(FALSE);
2833 if (hSysMenu != NULL)
2834 {
2835 /* Disable all items that are not relevant */
2836 for (i = 0; i < _countof(uidDisableItem); i++)
2837 {
2838 EnableMenuItem(hSysMenu,
2839 uidDisableItem[i],
2841 }
2842
2843 EnableMenuItem(hSysMenu,
2844 SC_CLOSE,
2845 MF_BYCOMMAND |
2847
2848 /* Display the system menu */
2849 uId = TrackMenu(
2850 hSysMenu,
2851 NULL,
2854 FALSE);
2855 if (uId != 0)
2856 {
2858 }
2859 }
2860
2861 /* revert the system menu window style */
2863 break;
2864 }
2865
2866 default:
2867 bHandled = FALSE;
2868 }
2869 return TRUE;
2870 }
UINT TrackMenu(IN HMENU hMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN BOOL IsContextMenu)
Definition: traywnd.cpp:924
#define WS_SYSMENU
Definition: pedump.c:629
#define WM_SYSCOMMAND
Definition: winuser.h:1769
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
#define SC_SIZE
Definition: winuser.h:2620
#define SC_MINIMIZE
Definition: winuser.h:2622
#define SC_CLOSE
Definition: winuser.h:2628
#define SC_MOVE
Definition: winuser.h:2621
#define SC_RESTORE
Definition: winuser.h:2634
#define SC_MAXIMIZE
Definition: winuser.h:2624

◆ OnSysColorChange()

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

Definition at line 2654 of file traywnd.cpp.

2655 {
2656 return SendMessageW(m_Rebar, uMsg, wParam, lParam);
2657 }

◆ OnSysCommand()

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

Definition at line 3135 of file traywnd.cpp.

3136 {
3137 if (wParam == SC_CLOSE)
3138 {
3139 return DoExitWindows();
3140 }
3141
3142 bHandled = FALSE;
3143 return TRUE;
3144 }

◆ OnTaskbarSettingsChanged()

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

Definition at line 3451 of file traywnd.cpp.

3452 {
3453 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
3454
3455 /* Propagate the new settings to the children */
3458
3459 /* Toggle autohide */
3460 SetAutoHideState(newSettings->sr.AutoHide);
3461
3462 /* Toggle lock state */
3463 Lock(newSettings->bLock);
3464
3465 /* Toggle OnTop state */
3466 UpdateAlwaysOnTop(newSettings->sr.AlwaysOnTop);
3467
3468 /* Adjust taskbar size */
3470
3472 return 0;
3473 }
void SetAutoHideState(_In_ BOOL bAutoHide) override
Definition: traywnd.cpp:3697
void UpdateAlwaysOnTop(_In_ BOOL bAlwaysOnTop) override
Definition: traywnd.cpp:3709

◆ OnThemeChanged()

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

Definition at line 2524 of file traywnd.cpp.

2525 {
2526 if (m_Theme)
2528
2529 m_Theme = OpenThemeData(m_hWnd, L"TaskBar");
2530
2531 if (m_Theme)
2532 {
2534 }
2535 else
2536 {
2538 }
2540
2541 return TRUE;
2542 }
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
Definition: system.c:890
#define WS_BORDER
Definition: pedump.c:625
#define WS_THICKFRAME
Definition: pedump.c:630

◆ OnTimer()

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

Definition at line 3280 of file traywnd.cpp.

3281 {
3282 switch (wParam)
3283 {
3286 break;
3287 case TIMER_ID_AUTOHIDE:
3289 break;
3290 default:
3291 WARN("Invalid timer ID: %u\n", (UINT)wParam);
3292 bHandled = FALSE;
3293 break;
3294 }
3295 return 0;
3296 }
#define WARN(fmt,...)
Definition: precomp.h:61
void ProcessMouseTracking()
Definition: traywnd.cpp:1962
void ProcessAutoHide()
Definition: traywnd.cpp:2009

◆ OnWindowPosChanging()

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

Definition at line 2751 of file traywnd.cpp.

2752 {
2754 return TRUE;
2755 }
VOID ChangingWinPos(IN OUT LPWINDOWPOS pwp)
Definition: traywnd.cpp:1453

◆ OnWinMMDeviceChange()

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

Definition at line 3548 of file traywnd.cpp.

3549 {
3550 /* CTaskSwitchWnd does not receive this message directly */
3552 return TRUE;
3553 }

◆ Open()

HRESULT STDMETHODCALLTYPE CTrayWindow::Open ( )
inline

Definition at line 2184 of file traywnd.cpp.

2185 {
2186 RECT rcWnd;
2187
2188 /* Check if there's already a window created and try to show it.
2189 If it was somehow destroyed just create a new tray window. */
2190 if (m_hWnd != NULL && IsWindow())
2191 {
2192 return S_OK;
2193 }
2194
2197 dwExStyle |= WS_EX_TOPMOST;
2198
2200 if(!m_Theme)
2201 {
2202 dwStyle |= WS_THICKFRAME | WS_BORDER;
2203 }
2204
2205 ZeroMemory(&rcWnd, sizeof(rcWnd));
2206 if (m_Position != (DWORD) -1)
2207 rcWnd = m_TrayRects[m_Position];
2208
2209 if (!Create(NULL, rcWnd, NULL, dwStyle, dwExStyle))
2210 return E_FAIL;
2211
2212 /* Align all controls on the tray window */
2214
2215 /* Move the tray window to the right position and resize it if necessary */
2217
2218 return S_OK;
2219 }
@ Create
Definition: registry.c:563
#define WS_POPUP
Definition: pedump.c:616
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407

◆ OpenCommonStartMenuDirectory()

VOID CTrayWindow::OpenCommonStartMenuDirectory ( IN HWND  hWndOwner,
IN LPCTSTR  lpOperation 
)
inline

Definition at line 619 of file traywnd.cpp.

620 {
621 WCHAR szDir[MAX_PATH];
622
623 if (SHGetSpecialFolderPath(hWndOwner,
624 szDir,
626 FALSE))
627 {
628 ShellExecute(hWndOwner,
629 lpOperation,
630 szDir,
631 NULL,
632 NULL,
634 }
635 }
#define MAX_PATH
Definition: compat.h:34
#define ShellExecute
Definition: shellapi.h:746
#define SHGetSpecialFolderPath
Definition: shlobj.h:1547
#define CSIDL_COMMON_STARTMENU
Definition: shlobj.h:2212

Referenced by ExecContextMenuCmd().

◆ OpenTaskManager()

VOID CTrayWindow::OpenTaskManager ( IN HWND  hWndOwner)
inline

Definition at line 637 of file traywnd.cpp.

638 {
639 ShellExecute(hWndOwner,
640 TEXT("open"),
641 TEXT("taskmgr.exe"),
642 NULL,
643 NULL,
645 }

Referenced by ExecContextMenuCmd(), and HandleCommand().

◆ PopupStartMenu()

void CTrayWindow::PopupStartMenu ( )
inline

Definition at line 1921 of file traywnd.cpp.

1922 {
1923 if (m_StartMenuPopup != NULL)
1924 {
1925 POINTL pt;
1926 RECTL rcExclude;
1927 DWORD dwFlags = 0;
1928
1929 if (m_StartButton.GetWindowRect((RECT*) &rcExclude))
1930 {
1931 switch (m_Position)
1932 {
1933 case ABE_BOTTOM:
1934 pt.x = rcExclude.left;
1935 pt.y = rcExclude.top;
1936 dwFlags |= MPPF_TOP;
1937 break;
1938 case ABE_TOP:
1939 pt.x = rcExclude.left;
1940 pt.y = rcExclude.bottom;
1941 dwFlags |= MPPF_BOTTOM;
1942 break;
1943 case ABE_LEFT:
1944 pt.x = rcExclude.right;
1945 pt.y = rcExclude.top;
1946 dwFlags |= MPPF_RIGHT;
1947 break;
1948 case ABE_RIGHT:
1949 pt.x = rcExclude.left;
1950 pt.y = rcExclude.top;
1951 dwFlags |= MPPF_LEFT;
1952 break;
1953 }
1954
1955 m_StartMenuPopup->Popup(&pt, &rcExclude, dwFlags);
1956
1957 m_StartButton.SendMessageW(BM_SETSTATE, TRUE, 0);
1958 }
1959 }
1960 }

Referenced by OnNcLButtonDown(), and OnOpenStartMenu().

◆ ProcessAutoHide()

void CTrayWindow::ProcessAutoHide ( )
inline

Definition at line 2009 of file traywnd.cpp.

2010 {
2013
2014 switch (m_AutoHideState)
2015 {
2016 case AUTOHIDE_HIDING:
2017 switch (m_Position)
2018 {
2019 case ABE_LEFT:
2020 m_AutoHideOffset.cy = 0;
2022 if (m_AutoHideOffset.cx < -w)
2024 break;
2025 case ABE_TOP:
2026 m_AutoHideOffset.cx = 0;
2028 if (m_AutoHideOffset.cy < -h)
2030 break;
2031 case ABE_RIGHT:
2032 m_AutoHideOffset.cy = 0;
2034 if (m_AutoHideOffset.cx > w)
2036 break;
2037 case ABE_BOTTOM:
2038 m_AutoHideOffset.cx = 0;
2040 if (m_AutoHideOffset.cy > h)
2042 break;
2043 }
2044
2046 {
2048 break;
2049 }
2050
2051 /* fallthrough */
2052 case AUTOHIDE_HIDDEN:
2053 switch (m_Position)
2054 {
2055 case ABE_LEFT:
2057 m_AutoHideOffset.cy = 0;
2058 break;
2059 case ABE_TOP:
2060 m_AutoHideOffset.cx = 0;
2062 break;
2063 case ABE_RIGHT:
2065 m_AutoHideOffset.cy = 0;
2066 break;
2067 case ABE_BOTTOM:
2068 m_AutoHideOffset.cx = 0;
2070 break;
2071 }
2072
2075 break;
2076
2077 case AUTOHIDE_SHOWING:
2079 {
2081 }
2083 {
2085 }
2086 else
2087 {
2088 m_AutoHideOffset.cx = 0;
2089 }
2090
2092 {
2094 }
2096 {
2098 }
2099 else
2100 {
2101 m_AutoHideOffset.cy = 0;
2102 }
2103
2104 if (m_AutoHideOffset.cx != 0 || m_AutoHideOffset.cy != 0)
2105 {
2107 break;
2108 }
2109
2110 /* fallthrough */
2111 case AUTOHIDE_SHOWN:
2114 break;
2115 }
2116
2118 }
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define AUTOHIDE_SHOWN
Definition: traywnd.cpp:31
#define AUTOHIDE_SPEED_HIDE
Definition: traywnd.cpp:27
#define AUTOHIDE_SPEED_SHOW
Definition: traywnd.cpp:26
#define AUTOHIDE_SHOWING
Definition: traywnd.cpp:30
#define AUTOHIDE_HIDDEN
Definition: traywnd.cpp:29
#define AUTOHIDE_INTERVAL_ANIMATING
Definition: traywnd.cpp:24
int32_t INT
Definition: typedefs.h:58

Referenced by OnTimer().

◆ ProcessMouseTracking()

void CTrayWindow::ProcessMouseTracking ( )
inline

Definition at line 1962 of file traywnd.cpp.

1963 {
1964 POINT pt;
1965 GetCursorPos(&pt);
1966
1967 RECT rcCurrent;
1968 GetWindowRect(&rcCurrent);
1969
1970 BOOL over = PtInRect(&rcCurrent, pt);
1972 over = TRUE;
1973
1975 if (over)
1976 {
1977 if (state == AUTOHIDE_HIDING)
1978 {
1979 TRACE("AutoHide cancelling hide.\n");
1982 }
1983 else if (state == AUTOHIDE_HIDDEN)
1984 {
1985 TRACE("AutoHide starting show.\n");
1988 }
1989 }
1990 else
1991 {
1992 if (state == AUTOHIDE_SHOWING)
1993 {
1994 TRACE("AutoHide cancelling show.\n");
1997 }
1998 else if (state == AUTOHIDE_SHOWN)
1999 {
2000 TRACE("AutoHide starting hide.\n");
2003 }
2004
2006 }
2007 }
static int state
Definition: maze.c:121
#define BST_UNCHECKED
Definition: winuser.h:199
#define AUTOHIDE_DELAY_SHOW
Definition: traywnd.cpp:23

Referenced by OnTimer().

◆ QueryContextMenu()

HRESULT STDMETHODCALLTYPE CTrayWindow::QueryContextMenu ( HMENU  hPopup,
UINT  indexMenu,
UINT  idCmdFirst,
UINT  idCmdLast,
UINT  uFlags 
)
inline

Implements IContextMenu.

Definition at line 2320 of file traywnd.cpp.

2325 {
2326 if (!m_ContextMenu)
2327 {
2330 return hr;
2331 }
2332
2333 return m_ContextMenu->QueryContextMenu(hPopup, indexMenu, idCmdFirst, idCmdLast, uFlags);
2334 }
UINT uFlags
Definition: api.c:59
HRESULT TrayWindowCtxMenuCreator(ITrayWindow *TrayWnd, IN HWND hWndOwner, IContextMenu **ppCtxMenu)
Definition: traywnd.cpp:3850

◆ RaiseStartButton()

virtual HRESULT CTrayWindow::RaiseStartButton ( )
inlinevirtual

Definition at line 3640 of file traywnd.cpp.

3641 {
3642 m_StartButton.SendMessageW(BM_SETSTATE, FALSE, 0);
3643 return S_OK;
3644 }

Referenced by Tray_OnStartMenuDismissed().

◆ RefreshStartMenuSettings()

void CTrayWindow::RefreshStartMenuSettings ( )
inline

Definition at line 467 of file traywnd.cpp.

468 {
469 IUnknown_Exec(m_StartMenuPopup, CLSID_MenuBand, 0x10000000, 0, NULL, NULL);
470 }

Referenced by DoExitWindows(), and HandleCommand().

◆ RegisterDesktopWindow()

STDMETHODIMP CTrayWindow::RegisterDesktopWindow ( IN HWND  hWndDesktop)
inlineoverride

Definition at line 3625 of file traywnd.cpp.

3626 {
3627 TRACE("IShellDesktopTray::RegisterDesktopWindow(0x%p)\n", hWndDesktop);
3628
3629 m_DesktopWnd = hWndDesktop;
3630 return S_OK;
3631 }

◆ RegLoadSettings()

VOID CTrayWindow::RegLoadSettings ( )
inline

Definition at line 1657 of file traywnd.cpp.

1658 {
1659 DWORD Pos;
1660 RECT rcScreen;
1661 SIZE WndSize, EdgeSize, DlgFrameSize;
1662 SIZE StartBtnSize = m_StartButton.GetSize();
1663
1664 EdgeSize.cx = GetSystemMetrics(SM_CXEDGE);
1665 EdgeSize.cy = GetSystemMetrics(SM_CYEDGE);
1666 DlgFrameSize.cx = GetSystemMetrics(SM_CXDLGFRAME);
1667 DlgFrameSize.cy = GetSystemMetrics(SM_CYDLGFRAME);
1668
1670 rcScreen = g_TaskbarSettings.sr.Rect;
1671 GetScreenRectFromRect(&rcScreen, MONITOR_DEFAULTTONEAREST);
1672
1674 {
1675 /* Use the minimum size of the taskbar, we'll use the start
1676 button as a minimum for now. Make sure we calculate the
1677 entire window size, not just the client size. However, we
1678 use a thinner border than a standard thick border, so that
1679 the start button and bands are not stuck to the screen border. */
1680 if(!m_Theme)
1681 {
1682 g_TaskbarSettings.sr.Size.cx = StartBtnSize.cx + (2 * (EdgeSize.cx + DlgFrameSize.cx));
1683 g_TaskbarSettings.sr.Size.cy = StartBtnSize.cy + (2 * (EdgeSize.cy + DlgFrameSize.cy));
1684 }
1685 else
1686 {
1687 g_TaskbarSettings.sr.Size.cx = StartBtnSize.cx - EdgeSize.cx;
1688 g_TaskbarSettings.sr.Size.cy = StartBtnSize.cy - EdgeSize.cy;
1691 }
1692 }
1693 /* Determine a minimum tray window rectangle. The "client" height is
1694 zero here since we cannot determine an optimal minimum width when
1695 loaded as a vertical tray window. We just need to make sure the values
1696 loaded from the registry are at least. The windows explorer behaves
1697 the same way, it allows the user to save a zero width vertical tray
1698 window, but not a zero height horizontal tray window. */
1699 if(!m_Theme)
1700 {
1701 WndSize.cx = 2 * (EdgeSize.cx + DlgFrameSize.cx);
1702 WndSize.cy = StartBtnSize.cy + (2 * (EdgeSize.cy + DlgFrameSize.cy));
1703 }
1704 else
1705 {
1706 WndSize.cx = StartBtnSize.cx;
1707 WndSize.cy = StartBtnSize.cy - EdgeSize.cy;
1708 }
1709
1710 if (WndSize.cx < g_TaskbarSettings.sr.Size.cx)
1711 WndSize.cx = g_TaskbarSettings.sr.Size.cx;
1712 if (WndSize.cy < g_TaskbarSettings.sr.Size.cy)
1713 WndSize.cy = g_TaskbarSettings.sr.Size.cy;
1714
1715 /* Save the calculated size */
1716 m_TraySize = WndSize;
1717
1718 /* Calculate all docking rectangles. We need to do this here so they're
1719 initialized and dragging the tray window to another position gives
1720 usable results */
1721 for (Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++)
1722 {
1724 &rcScreen,
1725 &m_TraySize,
1726 &m_TrayRects[Pos]);
1727 // TRACE("m_TrayRects[%d(%d)]: %d,%d,%d,%d\n", Pos, Position, m_TrayRects[Pos].left, m_TrayRects[Pos].top, m_TrayRects[Pos].right, m_TrayRects[Pos].bottom);
1728 }
1729
1730 /* Determine which monitor we are on. It shouldn't matter which docked
1731 position rectangle we use */
1733 }
#define SM_CXDLGFRAME
Definition: winuser.h:977
#define SM_CYDLGFRAME
Definition: winuser.h:979

Referenced by OnCreate(), and OnDisplayChange().

◆ ResizeWorkArea()

VOID CTrayWindow::ResizeWorkArea ( )
inline

Definition at line 1583 of file traywnd.cpp.

1584 {
1585#if !WIN7_DEBUG_MODE
1586 RECT rcTray, rcWorkArea;
1587
1588 /* If monitor has changed then fix the previous monitors work area */
1590 {
1591 GetScreenRect(m_PreviousMonitor, &rcWorkArea);
1592 SystemParametersInfoW(SPI_SETWORKAREA,
1593 1,
1594 &rcWorkArea,
1596 }
1597
1598 rcTray = m_TrayRects[m_Position];
1599
1600 GetScreenRect(m_Monitor, &rcWorkArea);
1602
1603 /* If AutoHide is false then change the workarea to exclude
1604 the area that the taskbar covers. */
1605 if (!IsAutoHideState())
1606 {
1607 switch (m_Position)
1608 {
1609 case ABE_TOP:
1610 rcWorkArea.top = rcTray.bottom;
1611 break;
1612 case ABE_LEFT:
1613 rcWorkArea.left = rcTray.right;
1614 break;
1615 case ABE_RIGHT:
1616 rcWorkArea.right = rcTray.left;
1617 break;
1618 case ABE_BOTTOM:
1619 rcWorkArea.bottom = rcTray.top;
1620 break;
1621 }
1622 }
1623
1624 /*
1625 * Resize the current monitor work area. Win32k will also send
1626 * a WM_SIZE message to automatically resize the desktop.
1627 */
1628 SystemParametersInfoW(SPI_SETWORKAREA,
1629 1,
1630 &rcWorkArea,
1632#endif
1633 }
#define SPIF_SENDCHANGE
Definition: winuser.h:1600
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)

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

◆ RestoreAll()

VOID CTrayWindow::RestoreAll ( )
inline

Definition at line 3240 of file traywnd.cpp.

3241 {
3242 for (INT i = g_MinimizedAll.GetSize() - 1; i >= 0; --i)
3243 {
3244 HWND hwnd = g_MinimizedAll[i].hwnd;
3247 }
3248
3250 }
int GetSize() const
Definition: atlsimpcoll.h:104
BOOL IsIconic() const
Definition: atlwin.h:932
BOOL WINAPI SetWindowPlacement(_In_ HWND hWnd, _In_ const WINDOWPLACEMENT *)

Referenced by ExecContextMenuCmd(), HandleCommand(), HandleHotKey(), and ToggleDesktop().

◆ RunFileDlgThread()

DWORD WINAPI CTrayWindow::RunFileDlgThread ( )
inline

Definition at line 501 of file traywnd.cpp.

502 {
503 HWND hwnd;
504 RECT posRect;
505
507
509 WC_STATIC,
510 NULL,
512 posRect.left,
513 posRect.top,
514 posRect.right - posRect.left,
515 posRect.bottom - posRect.top,
516 NULL,
517 NULL,
518 NULL,
519 NULL);
520
522
523 // build the default directory from two environment variables
524 CStringW strDefaultDir, strHomePath;
525 strDefaultDir.GetEnvironmentVariable(L"HOMEDRIVE");
526 strHomePath.GetEnvironmentVariable(L"HOMEPATH");
527 strDefaultDir += strHomePath;
528
530
533
534 return 0;
535 }
BOOL GetEnvironmentVariable(_In_z_ PCXSTR pszVar)
Definition: cstringt.h:658
void WINAPI RunFileDlg(HWND hWndOwner, HICON hIcon, LPCWSTR lpstrDirectory, LPCWSTR lpstrTitle, LPCWSTR lpstrDescription, UINT uFlags)
Definition: dialogs.cpp:400
#define WS_OVERLAPPED
Definition: pedump.c:615
#define WS_DISABLED
Definition: pedump.c:621
#define SS_LEFT
Definition: pedump.c:692
#define WC_STATIC
Definition: commctrl.h:4687
#define CreateWindowEx
Definition: winuser.h:5921
#define RFF_CALCDIRECTORY
Definition: run.h:35

◆ s_RunFileDlgThread()

static DWORD WINAPI CTrayWindow::s_RunFileDlgThread ( IN OUT PVOID  pParam)
inlinestatic

Definition at line 537 of file traywnd.cpp.

538 {
539 CTrayWindow * This = (CTrayWindow*) pParam;
540 return This->RunFileDlgThread();
541 }

Referenced by DisplayRunFileDlg().

◆ s_TrayPropertiesThread()

static DWORD WINAPI CTrayWindow::s_TrayPropertiesThread ( IN OUT PVOID  pParam)
inlinestatic

Definition at line 591 of file traywnd.cpp.

592 {
593 CTrayWindow *This = (CTrayWindow*) pParam;
594
595 return This->TrayPropertiesThread();
596 }

Referenced by DisplayProperties().

◆ SaveState()

void CTrayWindow::SaveState ( )
inline

Definition at line 456 of file traywnd.cpp.

457 {
459 return;
460
462
465 }
VOID ClearRecentAndMru()
@ REST_NOSAVESET
Definition: shlobj.h:1662
@ REST_CLEARRECENTDOCSONEXIT
Definition: shlobj.h:1696
#define WM_PROGMAN_SAVESTATE
Definition: undocshell.h:74

Referenced by DoExitWindows(), HandleCommand(), and OnEndSession().

◆ SetAutoHideState()

void CTrayWindow::SetAutoHideState ( _In_ BOOL  bAutoHide)
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3697 of file traywnd.cpp.

3698 {
3699 g_TaskbarSettings.sr.AutoHide = bAutoHide;
3701
3703 if (bAutoHide)
3705 else
3707 }

Referenced by OnTaskbarSettingsChanged().

◆ ShowDesktop()

VOID CTrayWindow::ShowDesktop ( )
inline

Definition at line 3235 of file traywnd.cpp.

3236 {
3238 }

Referenced by ExecContextMenuCmd(), HandleCommand(), and ToggleDesktop().

◆ ShowFolder()

VOID CTrayWindow::ShowFolder ( INT  csidl,
BOOL  bExplore 
)
inline

Definition at line 751 of file traywnd.cpp.

752 {
753 SHELLEXECUTEINFOW sei = { sizeof(sei), SEE_MASK_INVOKEIDLIST };
754 if (bExplore)
755 sei.lpVerb = L"explore";
756 sei.nShow = SW_SHOWNORMAL;
758 if (sei.lpIDList)
759 {
760 ShellExecuteExW(&sei);
762 }
763 }
LPITEMIDLIST WINAPI SHCloneSpecialIDList(HWND hwndOwner, int nFolder, BOOL fCreate)
Definition: pidl.c:446
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1051
#define SEE_MASK_INVOKEIDLIST
Definition: shellapi.h:28
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2732
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41

Referenced by HandleCommand(), and HandleHotKey().

◆ ToggleDesktop()

VOID CTrayWindow::ToggleDesktop ( )
inline

Definition at line 647 of file traywnd.cpp.

648 {
650 {
651 ShowDesktop();
652 }
653 else
654 {
655 RestoreAll();
656 }
657 }

Referenced by HandleCommand(), and HandleHotKey().

◆ TrackCtxMenu()

HRESULT CTrayWindow::TrackCtxMenu ( IN IContextMenu *  contextMenu,
IN POINT *ppt  OPTIONAL,
IN HWND hwndExclude  OPTIONAL,
IN BOOL  TrackUp,
IN PVOID Context  OPTIONAL 
)
inline

Definition at line 995 of file traywnd.cpp.

1001 {
1002 POINT pt;
1004 RECT rc;
1005 HRESULT hr;
1006 UINT uCommand;
1007 HMENU popup = CreatePopupMenu();
1008
1009 if (popup == NULL)
1010 return E_FAIL;
1011
1012 if (ppt)
1013 {
1014 pt = *ppt;
1015 }
1016 else
1017 {
1018 ::GetWindowRect(m_hWnd, &rc);
1019 pt.x = rc.left;
1020 pt.y = rc.top;
1021 }
1022
1023 TRACE("Before Query\n");
1024 hr = contextMenu->QueryContextMenu(popup, 0, 0, UINT_MAX, CMF_NORMAL);
1026 {
1027 TRACE("Query failed\n");
1028 DestroyMenu(popup);
1029 return hr;
1030 }
1031
1032 TRACE("Before Tracking\n");
1034 if (hwndExclude)
1035 {
1036 ::GetWindowRect(hwndExclude, &rc);
1037 ZeroMemory(&params, sizeof(params));
1038 params.cbSize = sizeof(params);
1039 params.rcExclude = rc;
1040 uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, pt.x, pt.y, m_hWnd, &params);
1041 }
1042 else
1043 {
1044 uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, pt.x, pt.y, m_hWnd, NULL);
1045 }
1047
1048 if (uCommand != 0)
1049 {
1050 TRACE("Before InvokeCommand\n");
1051 CMINVOKECOMMANDINFO cmi = { 0 };
1052 cmi.cbSize = sizeof(cmi);
1053 cmi.lpVerb = MAKEINTRESOURCEA(uCommand);
1054 cmi.hwnd = m_hWnd;
1055 hr = contextMenu->InvokeCommand(&cmi);
1056 }
1057 else
1058 {
1059 TRACE("TrackPopupMenu failed. Code=%d, LastError=%d\n", uCommand, GetLastError());
1060 hr = S_FALSE;
1061 }
1062
1063 DestroyMenu(popup);
1064 return hr;
1065 }
#define UINT_MAX
Definition: limits.h:27
GLenum const GLfloat * params
Definition: glext.h:5645
struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
#define WM_NULL
Definition: winuser.h:1635
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define TPM_RETURNCMD
Definition: winuser.h:2423
#define S_FALSE
Definition: winerror.h:3451

Referenced by OnContextMenu().

◆ TrackMenu()

UINT CTrayWindow::TrackMenu ( IN HMENU  hMenu,
IN POINT *ppt  OPTIONAL,
IN HWND hwndExclude  OPTIONAL,
IN BOOL  TrackUp,
IN BOOL  IsContextMenu 
)
inline

Definition at line 924 of file traywnd.cpp.

930 {
931 TPMPARAMS tmp, *ptmp = NULL;
932 POINT pt;
933 UINT cmdId;
934 UINT fuFlags;
935
936 if (hwndExclude != NULL)
937 {
938 /* Get the client rectangle and map it to screen coordinates */
939 if (::GetClientRect(hwndExclude,
940 &tmp.rcExclude) &&
941 ::MapWindowPoints(hwndExclude,
942 NULL,
943 (LPPOINT) &tmp.rcExclude,
944 2) != 0)
945 {
946 ptmp = &tmp;
947 }
948 }
949
950 if (ppt == NULL)
951 {
952 if (ptmp == NULL &&
953 GetClientRect(&tmp.rcExclude) &&
955 NULL,
956 (LPPOINT) &tmp.rcExclude,
957 2) != 0)
958 {
959 ptmp = &tmp;
960 }
961
962 if (ptmp != NULL)
963 {
964 /* NOTE: TrackPopupMenuEx will eventually align the track position
965 for us, no need to take care of it here as long as the
966 coordinates are somewhere within the exclusion rectangle */
967 pt.x = ptmp->rcExclude.left;
968 pt.y = ptmp->rcExclude.top;
969 }
970 else
971 pt.x = pt.y = 0;
972 }
973 else
974 pt = *ppt;
975
976 tmp.cbSize = sizeof(tmp);
977
978 fuFlags = TPM_RETURNCMD | TPM_VERTICAL;
979 fuFlags |= (TrackUp ? TPM_BOTTOMALIGN : TPM_TOPALIGN);
980 if (IsContextMenu)
981 fuFlags |= TPM_RIGHTBUTTON;
982 else
983 fuFlags |= (TrackUp ? TPM_VERNEGANIMATION : TPM_VERPOSANIMATION);
984
985 cmdId = TrackPopupMenuEx(hMenu,
986 fuFlags,
987 pt.x,
988 pt.y,
989 m_hWnd,
990 ptmp);
991
992 return cmdId;
993 }
#define TPM_RIGHTBUTTON
Definition: winuser.h:2416
#define TPM_BOTTOMALIGN
Definition: winuser.h:2421
#define TPM_TOPALIGN
Definition: winuser.h:2419
#define TPM_VERTICAL
Definition: winuser.h:2418
RECT rcExclude
Definition: winuser.h:3684
UINT cbSize
Definition: winuser.h:3683

Referenced by OnSysChar().

◆ TrayMessageLoop()

VOID CTrayWindow::TrayMessageLoop ( )
inline

Definition at line 3575 of file traywnd.cpp.

3576 {
3577 MSG Msg;
3578 BOOL Ret;
3579
3580 /* FIXME: We should keep a reference here... */
3581
3582 while (true)
3583 {
3584 Ret = GetMessage(&Msg, NULL, 0, 0);
3585
3586 if (!Ret || Ret == -1)
3587 break;
3588
3589 if (m_StartMenuBand == NULL ||
3590 m_StartMenuBand->IsMenuMessage(&Msg) != S_OK)
3591 {
3594 }
3595 }
3596 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define GetMessage
Definition: winuser.h:5956
#define DispatchMessage
Definition: winuser.h:5931

Referenced by TrayMessageLoop().

◆ TrayProcessMessages()

VOID CTrayWindow::TrayProcessMessages ( )
inline

Definition at line 3555 of file traywnd.cpp.

3556 {
3557 MSG Msg;
3558
3559 /* FIXME: We should keep a reference here... */
3560
3561 while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
3562 {
3563 if (Msg.message == WM_QUIT)
3564 break;
3565
3566 if (m_StartMenuBand == NULL ||
3567 m_StartMenuBand->IsMenuMessage(&Msg) != S_OK)
3568 {
3571 }
3572 }
3573 }
#define PM_REMOVE
Definition: winuser.h:1207
#define PeekMessage
Definition: winuser.h:5996

Referenced by TrayProcessMessages().

◆ TrayPropertiesThread()

DWORD WINAPI CTrayWindow::TrayPropertiesThread ( )
inline

Definition at line 562 of file traywnd.cpp.

563 {
564 HWND hwnd;
565 RECT posRect;
566
569 WC_STATIC,
570 NULL,
572 posRect.left,
573 posRect.top,
574 posRect.right - posRect.left,
575 posRect.bottom - posRect.top,
576 NULL,
577 NULL,
578 NULL,
579 NULL);
580
582
584
587
588 return 0;
589 }
VOID DisplayTrayProperties(IN HWND hwndOwner, IN HWND hwndTaskbar)
Definition: trayprop.cpp:363

◆ Unknown()

STDMETHODIMP CTrayWindow::Unknown ( IN DWORD  dwUnknown1,
IN DWORD  dwUnknown2 
)
inlineoverride

Definition at line 3634 of file traywnd.cpp.

3635 {
3636 TRACE("IShellDesktopTray::Unknown(%u,%u) unimplemented!\n", dwUnknown1, dwUnknown2);
3637 return S_OK;
3638 }

◆ UpdateAlwaysOnTop()

void CTrayWindow::UpdateAlwaysOnTop ( _In_ BOOL  bAlwaysOnTop)
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3709 of file traywnd.cpp.

3710 {
3711 g_TaskbarSettings.sr.AlwaysOnTop = bAlwaysOnTop;
3712 HWND hwndInsertAfter = (bAlwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST);
3713 SetWindowPos(hwndInsertAfter, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
3714 }
#define HWND_TOPMOST
Definition: winuser.h:1219
#define HWND_NOTOPMOST
Definition: winuser.h:1217

Referenced by OnTaskbarSettingsChanged().

◆ UpdateFonts()

void CTrayWindow::UpdateFonts ( )
inline

Definition at line 1075 of file traywnd.cpp.

1076 {
1077 /* There is nothing to do if themes are enabled */
1078 if (m_Theme)
1079 return;
1080
1082
1083 NONCLIENTMETRICS ncm = {sizeof(ncm)};
1084 if (!SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, FALSE))
1085 {
1086 ERR("SPI_GETNONCLIENTMETRICS failed\n");
1087 return;
1088 }
1089
1090 if (m_Font != NULL)
1092
1093 ncm.lfCaptionFont.lfWeight = FW_NORMAL;
1094 m_Font = CreateFontIndirect(&ncm.lfCaptionFont);
1095 if (!m_Font)
1096 {
1097 ERR("CreateFontIndirect failed\n");
1098 return;
1099 }
1100
1104 }
VOID UpdateFont()
Definition: traywnd.cpp:228
#define WM_SETFONT
Definition: winuser.h:1678
#define FW_NORMAL
Definition: wingdi.h:373
#define CreateFontIndirect
Definition: wingdi.h:4890

Referenced by OnCreate(), and OnSettingChanged().

Member Data Documentation

◆ 

union { ... } CTrayWindow::@127

◆ Flags

DWORD CTrayWindow::Flags

Definition at line 363 of file traywnd.cpp.

◆ InSizeMove

DWORD CTrayWindow::InSizeMove

Definition at line 367 of file traywnd.cpp.

Referenced by ChangingWinPos(), OnEnterSizeMove(), and OnExitSizeMove().

◆ IsDragging

DWORD CTrayWindow::IsDragging

Definition at line 368 of file traywnd.cpp.

Referenced by ChangingWinPos(), OnEnterSizeMove(), and OnMoving().

◆ m_AutoHideOffset

SIZE CTrayWindow::m_AutoHideOffset
private

Definition at line 351 of file traywnd.cpp.

Referenced by ChangingWinPos(), CTrayWindow(), ProcessAutoHide(), and SetAutoHideState().

◆ m_AutoHideState

UINT CTrayWindow::m_AutoHideState
private

◆ m_ContextMenu

CComPtr<IContextMenu> CTrayWindow::m_ContextMenu
private

Definition at line 326 of file traywnd.cpp.

Referenced by GetCommandString(), InvokeCommand(), and QueryContextMenu().

◆ m_DesktopWnd

HWND CTrayWindow::m_DesktopWnd
private

◆ m_DraggingMonitor

HMONITOR CTrayWindow::m_DraggingMonitor
private

Definition at line 342 of file traywnd.cpp.

Referenced by ChangingWinPos(), and OnMoving().

◆ m_DraggingPosition

DWORD CTrayWindow::m_DraggingPosition
private

Definition at line 341 of file traywnd.cpp.

Referenced by ChangingWinPos(), and OnMoving().

◆ m_Font

HFONT CTrayWindow::m_Font
private

Definition at line 329 of file traywnd.cpp.

Referenced by UpdateFonts(), and ~CTrayWindow().

◆ m_Monitor

HMONITOR CTrayWindow::m_Monitor
private

◆ m_MouseTrackingInfo

TRACKMOUSEEVENT CTrayWindow::m_MouseTrackingInfo
private

Definition at line 352 of file traywnd.cpp.

Referenced by CTrayWindow().

◆ m_Position

◆ m_PreviousMonitor

HMONITOR CTrayWindow::m_PreviousMonitor
private

Definition at line 340 of file traywnd.cpp.

Referenced by GetPreviousMonitor(), OnEnterSizeMove(), and ResizeWorkArea().

◆ m_pShowDesktopButton

CTrayShowDesktopButton* CTrayWindow::m_pShowDesktopButton
private

◆ m_Rebar

HWND CTrayWindow::m_Rebar
private

◆ m_RunFileDlgOwner

HWND CTrayWindow::m_RunFileDlgOwner
private

Definition at line 348 of file traywnd.cpp.

Referenced by DisplayRunFileDlg(), and RunFileDlgThread().

◆ m_ShellServices

HDPA CTrayWindow::m_ShellServices
private

Definition at line 354 of file traywnd.cpp.

Referenced by OnCreate(), and ~CTrayWindow().

◆ m_StartButton

◆ m_StartMenuBand

CComPtr<IMenuBand> CTrayWindow::m_StartMenuBand
private

Definition at line 322 of file traywnd.cpp.

Referenced by if(), OnCreate(), OnSettingChanged(), TrayMessageLoop(), and TrayProcessMessages().

◆ m_StartMenuPopup

CComPtr<IMenuPopup> CTrayWindow::m_StartMenuPopup
private

◆ m_TaskBand

CComPtr<IDeskBand> CTrayWindow::m_TaskBand
private

Definition at line 325 of file traywnd.cpp.

Referenced by OnCreate().

◆ m_TaskSwitch

◆ m_Theme

◆ m_TrayBandSite

CComPtr<ITrayBandSite> CTrayWindow::m_TrayBandSite

◆ m_TrayNotify

◆ m_TrayNotifyInstance

CComPtr<IUnknown> CTrayWindow::m_TrayNotifyInstance
private

Definition at line 336 of file traywnd.cpp.

Referenced by OnCreate().

◆ m_TrayPropertiesOwner

HWND CTrayWindow::m_TrayPropertiesOwner
private

Definition at line 347 of file traywnd.cpp.

Referenced by DisplayProperties(), and TrayPropertiesThread().

◆ m_TrayRects

◆ m_TraySize

SIZE CTrayWindow::m_TraySize
private

◆ m_WinMMDevChgMsg

UINT CTrayWindow::m_WinMMDevChgMsg
private

Definition at line 356 of file traywnd.cpp.

Referenced by OnCreate().

◆ NewPosSize

DWORD CTrayWindow::NewPosSize

Definition at line 369 of file traywnd.cpp.


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