ReactOS  0.4.14-dev-815-ge410a12
CTrayNotifyWnd Class Reference
Inheritance diagram for CTrayNotifyWnd:
Collaboration diagram for CTrayNotifyWnd:

Public Member Functions

 CTrayNotifyWnd ()
 
virtual ~CTrayNotifyWnd ()
 
LRESULT OnThemeChanged ()
 
LRESULT OnThemeChanged (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCreate (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
BOOL GetMinimumSize (IN OUT PSIZE pSize)
 
VOID Size (IN const SIZE *pszClient)
 
LRESULT OnEraseBackground (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnGetMinimumSize (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSize (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNcHitTest (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCtxMenu (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnClockMessage (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnPagerMessage (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnRealign (INT uCode, LPNMHDR hdr, BOOL &bHandled)
 
HRESULT WINAPI GetWindow (HWND *phwnd)
 
HRESULT WINAPI ContextSensitiveHelp (BOOL fEnterMode)
 
HRESULT Initialize (IN HWND hwndParent)
 
- 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< CTrayNotifyWnd, CWindow, CControlWinTraits >
HWND Create (HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
- Public Member Functions inherited from ATL::CWindowImplBaseT< CWindow, CControlWinTraits >
 CWindowImplBaseT ()
 
virtual void OnFinalMessage (HWND)
 
BOOL SubclassWindow (HWND hWnd)
 
virtual WNDPROC GetWindowProc ()
 
LRESULT DefWindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
HWND Create (HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName, DWORD dwStyle, DWORD dwExStyle, _U_MENUorID MenuOrID, ATOM atom, LPVOID lpCreateParam)
 
- Public Member Functions inherited from ATL::CWindowImplRoot< CWindow >
 CWindowImplRoot ()
 
virtual ~CWindowImplRoot ()
 
- Public Member Functions inherited from ATL::CWindow
 CWindow (HWND hWnd=NULL)
 
 operator HWND () const
 
UINT ArrangeIconicWindows ()
 
void Attach (HWND hWndNew)
 
HDC BeginPaint (LPPAINTSTRUCT lpPaint)
 
BOOL BringWindowToTop ()
 
BOOL CenterWindow (HWND hWndCenter=NULL)
 
BOOL ChangeClipboardChain (HWND hWndNewNext)
 
BOOL CheckDlgButton (int nIDButton, UINT nCheck)
 
BOOL CheckRadioButton (int nIDFirstButton, int nIDLastButton, int nIDCheckButton)
 
HWND ChildWindowFromPoint (POINT point) const
 
HWND ChildWindowFromPointEx (POINT point, UINT uFlags) const
 
BOOL ClientToScreen (LPPOINT lpPoint) const
 
BOOL ClientToScreen (LPRECT lpRect) const
 
HWND Create (LPCTSTR lpstrWndClass, HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
BOOL CreateCaret (HBITMAP pBitmap)
 
BOOL CreateGrayCaret (int nWidth, int nHeight)
 
BOOL CreateSolidCaret (int nWidth, int nHeight)
 
HDWP DeferWindowPos (HDWP hWinPosInfo, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags)
 
BOOL DestroyWindow ()
 
HWND Detach ()
 
int DlgDirList (LPTSTR lpPathSpec, int nIDListBox, int nIDStaticPath, UINT nFileType)
 
int DlgDirListComboBox (LPTSTR lpPathSpec, int nIDComboBox, int nIDStaticPath, UINT nFileType)
 
BOOL DlgDirSelect (LPTSTR lpString, int nCount, int nIDListBox)
 
BOOL DlgDirSelectComboBox (LPTSTR lpString, int nCount, int nIDComboBox)
 
void DragAcceptFiles (BOOL bAccept=TRUE)
 
BOOL DrawMenuBar ()
 
BOOL EnableScrollBar (UINT uSBFlags, UINT uArrowFlags=ESB_ENABLE_BOTH)
 
BOOL EnableWindow (BOOL bEnable=TRUE)
 
void EndPaint (LPPAINTSTRUCT lpPaint)
 
BOOL FlashWindow (BOOL bInvert)
 
BOOL GetClientRect (LPRECT lpRect) const
 
HDC GetDC ()
 
HDC GetDCEx (HRGN hRgnClip, DWORD flags)
 
HWND GetDescendantWindow (int nID) const
 
HRESULT GetDlgControl (int nID, REFIID iid, void **ppCtrl)
 
int GetDlgCtrlID () const
 
HRESULT GetDlgHost (int nID, REFIID iid, void **ppHost)
 
HWND GetDlgItem (int nID)
 
UINT GetDlgItemInt (int nID, BOOL *lpTrans=NULL, BOOL bSigned=TRUE) const
 
UINT GetDlgItemText (int nID, LPTSTR lpStr, int nMaxCount) const
 
BOOL GetDlgItemText (int nID, BSTR &bstrText) const
 
DWORD GetExStyle () const
 
HFONT GetFont () const
 
DWORD GetHotKey () const
 
HICON GetIcon (BOOL bBigIcon=TRUE) const
 
HWND GetLastActivePopup () const
 
HMENU GetMenu () const
 
HWND GetNextDlgGroupItem (HWND hWndCtl, BOOL bPrevious=FALSE) const
 
HWND GetNextDlgTabItem (HWND hWndCtl, BOOL bPrevious=FALSE) const
 
CWindow GetParent () const
 
BOOL GetScrollInfo (int nBar, LPSCROLLINFO lpScrollInfo)
 
BOOL GetScrollPos (int nBar)
 
BOOL GetScrollRange (int nBar, LPINT lpMinPos, LPINT lpMaxPos) const
 
DWORD GetStyle () const
 
HMENU GetSystemMenu (BOOL bRevert)
 
HWND GetTopLevelParent () const
 
HWND GetTopLevelWindow () const
 
HWND GetTopWindow () const
 
BOOL GetUpdateRect (LPRECT lpRect, BOOL bErase=FALSE)
 
int GetUpdateRgn (HRGN hRgn, BOOL bErase=FALSE)
 
HWND GetWindow (UINT nCmd) const
 
DWORD GetWindowContextHelpId () const
 
HDC GetWindowDC ()
 
LONG GetWindowLong (int nIndex) const
 
LONG_PTR GetWindowLongPtr (int nIndex) const
 
BOOL GetWindowPlacement (WINDOWPLACEMENT *lpwndpl) const
 
DWORD GetWindowProcessID ()
 
BOOL GetWindowRect (LPRECT lpRect) const
 
int GetWindowRgn (HRGN hRgn)
 
int GetWindowText (LPTSTR lpszStringBuf, int nMaxCount) const
 
BOOL GetWindowText (BSTR &bstrText)
 
int GetWindowTextLength () const
 
DWORD GetWindowThreadID ()
 
WORD GetWindowWord (int nIndex) const
 
void GotoDlgCtrl (HWND hWndCtrl) const
 
BOOL HideCaret ()
 
BOOL HiliteMenuItem (HMENU hMenu, UINT uHiliteItem, UINT uHilite)
 
BOOL Invalidate (BOOL bErase=TRUE)
 
BOOL InvalidateRect (LPCRECT lpRect, BOOL bErase=TRUE)
 
void InvalidateRgn (HRGN hRgn, BOOL bErase=TRUE)
 
BOOL IsChild (const HWND hWnd) const
 
BOOL IsDialogMessage (LPMSG lpMsg)
 
UINT IsDlgButtonChecked (int nIDButton) const
 
BOOL IsIconic () const
 
BOOL IsParentDialog ()
 
BOOL IsWindow () const
 
BOOL IsWindowEnabled () const
 
BOOL IsWindowVisible () const
 
BOOL IsWindowUnicode ()
 
BOOL IsZoomed () const
 
BOOL KillTimer (UINT_PTR nIDEvent)
 
BOOL LockWindowUpdate (BOOL bLock=TRUE)
 
int MapWindowPoints (HWND hWndTo, LPPOINT lpPoint, UINT nCount) const
 
int MapWindowPoints (HWND hWndTo, LPRECT lpRect) const
 
int MessageBox (LPCTSTR lpszText, LPCTSTR lpszCaption=NULL, UINT nType=MB_OK)
 
BOOL ModifyStyle (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
 
BOOL ModifyStyleEx (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
 
BOOL MoveWindow (int x, int y, int nWidth, int nHeight, BOOL bRepaint=TRUE)
 
void NextDlgCtrl () const
 
BOOL OpenClipboard ()
 
BOOL PostMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
void PrevDlgCtrl () const
 
void Print (HDC hDC, DWORD dwFlags) const
 
void PrintClient (HDC hDC, DWORD dwFlags) const
 
BOOL RedrawWindow (LPCRECT lpRectUpdate=NULL, HRGN hRgnUpdate=NULL, UINT flags=RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE)
 
int ReleaseDC (HDC hDC)
 
BOOL ResizeClient (int nWidth, int nHeight, BOOL bRedraw=FALSE)
 
BOOL ScreenToClient (LPPOINT lpPoint) const
 
BOOL ScrollWindow (int xAmount, int yAmount, LPCRECT lpRect=NULL, LPCRECT lpClipRect=NULL)
 
int ScrollWindowEx (int dx, int dy, LPCRECT lpRectScroll, LPCRECT lpRectClip, HRGN hRgnUpdate, LPRECT lpRectUpdate, UINT flags)
 
LRESULT SendDlgItemMessage (int nID, UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
LRESULT SendMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
void SendMessageToDescendants (UINT message, WPARAM wParam=0, LPARAM lParam=0, BOOL bDeep=TRUE)
 
BOOL SendNotifyMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
HWND SetActiveWindow ()
 
HWND SetCapture ()
 
HWND SetClipboardViewer ()
 
int SetDlgCtrlID (int nID)
 
BOOL SetDlgItemInt (int nID, UINT nValue, BOOL bSigned=TRUE)
 
BOOL SetDlgItemText (int nID, LPCTSTR lpszString)
 
HWND SetFocus ()
 
void SetFont (HFONT hFont, BOOL bRedraw=TRUE)
 
int SetHotKey (WORD wVirtualKeyCode, WORD wModifiers)
 
HICON SetIcon (HICON hIcon, BOOL bBigIcon=TRUE)
 
BOOL SetMenu (HMENU hMenu)
 
HWND SetParent (HWND hWndNewParent)
 
void SetRedraw (BOOL bRedraw=TRUE)
 
int SetScrollInfo (int nBar, LPSCROLLINFO lpScrollInfo, BOOL bRedraw=TRUE)
 
int SetScrollPos (int nBar, int nPos, BOOL bRedraw=TRUE)
 
BOOL SetScrollRange (int nBar, int nMinPos, int nMaxPos, BOOL bRedraw=TRUE)
 
UINT_PTR SetTimer (UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL)
 
BOOL SetWindowContextHelpId (DWORD dwContextHelpId)
 
LONG SetWindowLong (int nIndex, LONG dwNewLong)
 
LONG_PTR SetWindowLongPtr (int nIndex, LONG_PTR dwNewLong)
 
BOOL SetWindowPlacement (const WINDOWPLACEMENT *lpwndpl)
 
BOOL SetWindowPos (HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
 
int SetWindowRgn (HRGN hRgn, BOOL bRedraw=FALSE)
 
BOOL SetWindowText (LPCTSTR lpszString)
 
WORD SetWindowWord (int nIndex, WORD wNewWord)
 
BOOL ShowCaret ()
 
BOOL ShowOwnedPopups (BOOL bShow=TRUE)
 
BOOL ShowScrollBar (UINT nBar, BOOL bShow=TRUE)
 
BOOL ShowWindow (int nCmdShow)
 
BOOL ShowWindowAsync (int nCmdShow)
 
BOOL UpdateWindow ()
 
BOOL ValidateRect (LPCRECT lpRect)
 
BOOL ValidateRgn (HRGN hRgn)
 
BOOL WinHelp (LPCTSTR lpszHelp, UINT nCmd=HELP_CONTEXT, DWORD dwData=0)
 
- Public Member Functions inherited from ATL::CMessageMap
virtual BOOL ProcessWindowMessage (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID)=0
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Private Attributes

CComPtr< IUnknownm_clock
 
CComPtr< IUnknownm_pager
 
HWND m_hwndClock
 
HWND m_hwndPager
 
HTHEME TrayTheme
 
SIZE szTrayClockMin
 
SIZE szTrayNotify
 
MARGINS ContentMargin
 
BOOL IsHorizontal
 

Additional Inherited Members

- Public Types inherited from ATL::CWindowImplRoot< CWindow >
enum  
 
- Public Types inherited from IOleWindow
typedef IOleWindowLPOLEWINDOW
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Static Public Member Functions inherited from ATL::CComCoClass< CTrayNotifyWnd >
static LPCTSTR WINAPI GetObjectDescription ()
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Static Public Member Functions inherited from ATL::CWindowImpl< CTrayNotifyWnd, CWindow, CControlWinTraits >
static LPCTSTR GetWndCaption ()
 
- Static Public Member Functions inherited from ATL::CWindowImplBaseT< CWindow, CControlWinTraits >
static DWORD GetWndStyle (DWORD dwStyle)
 
static DWORD GetWndExStyle (DWORD dwExStyle)
 
static LRESULT CALLBACK StartWindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CWindow
static LPCTSTR GetWndClassName ()
 
static LRESULT SendMessage (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Public Attributes inherited from ATL::CWindowImplBaseT< CWindow, CControlWinTraits >
WNDPROC m_pfnSuperWindowProc
 
- Public Attributes inherited from ATL::CWindowImplRoot< CWindow >
CWndProcThunk m_thunk
 
const _ATL_MSGm_pCurrentMsg
 
DWORD m_dwState
 
- Public Attributes inherited from ATL::CWindow
HWND m_hWnd
 
- Static Public Attributes inherited from ATL::CWindow
static RECT rcDefault
 

Detailed Description

Definition at line 33 of file trayntfy.cpp.

Constructor & Destructor Documentation

◆ CTrayNotifyWnd()

CTrayNotifyWnd::CTrayNotifyWnd ( )
inline

Definition at line 52 of file trayntfy.cpp.

52  :
55  TrayTheme(NULL),
57  {
61  }
HWND m_hwndClock
Definition: trayntfy.cpp:42
BOOL IsHorizontal
Definition: trayntfy.cpp:49
#define ZeroMemory
Definition: winbase.h:1642
HWND m_hwndPager
Definition: trayntfy.cpp:43
HTHEME TrayTheme
Definition: trayntfy.cpp:45
SIZE szTrayClockMin
Definition: trayntfy.cpp:46
smooth NULL
Definition: ftsmooth.c:416
MARGINS ContentMargin
Definition: trayntfy.cpp:48
SIZE szTrayNotify
Definition: trayntfy.cpp:47

◆ ~CTrayNotifyWnd()

virtual CTrayNotifyWnd::~CTrayNotifyWnd ( )
inlinevirtual

Definition at line 62 of file trayntfy.cpp.

62 { }

Member Function Documentation

◆ ContextSensitiveHelp()

HRESULT WINAPI CTrayNotifyWnd::ContextSensitiveHelp ( BOOL  fEnterMode)
inline

Implements IOleWindow.

Definition at line 332 of file trayntfy.cpp.

333  {
334  return E_NOTIMPL;
335  }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetMinimumSize()

BOOL CTrayNotifyWnd::GetMinimumSize ( IN OUT PSIZE  pSize)
inline

Definition at line 127 of file trayntfy.cpp.

128  {
129  SIZE szClock = { 0, 0 };
130  SIZE szTray = { 0, 0 };
131 
133  {
134  if (IsHorizontal)
135  {
136  szClock.cy = pSize->cy - 2 * TRAY_NOTIFY_WND_SPACING_Y;
137  if (szClock.cy <= 0)
138  goto NoClock;
139  }
140  else
141  {
142  szClock.cx = pSize->cx - 2 * TRAY_NOTIFY_WND_SPACING_X;
143  if (szClock.cx <= 0)
144  goto NoClock;
145  }
146 
148 
149  szTrayClockMin = szClock;
150  }
151  else
152  NoClock:
153  szTrayClockMin = szClock;
154 
155  if (IsHorizontal)
156  {
157  szTray.cy = pSize->cy - 2 * TRAY_NOTIFY_WND_SPACING_Y;
158  }
159  else
160  {
161  szTray.cx = pSize->cx - 2 * TRAY_NOTIFY_WND_SPACING_X;
162  }
163 
165 
166  szTrayNotify = szTray;
167 
168  if (IsHorizontal)
169  {
170  pSize->cx = 2 * TRAY_NOTIFY_WND_SPACING_X;
171 
174 
175  pSize->cx += szTray.cx;
177  }
178  else
179  {
180  pSize->cy = 2 * TRAY_NOTIFY_WND_SPACING_Y;
181 
184 
185  pSize->cy += szTray.cy;
187  }
188 
189  return TRUE;
190  }
#define TRAY_NOTIFY_WND_SPACING_X
Definition: trayntfy.cpp:30
#define TRUE
Definition: types.h:120
DWORD HideClock
Definition: precomp.h:195
HWND m_hwndClock
Definition: trayntfy.cpp:42
BOOL IsHorizontal
Definition: trayntfy.cpp:49
#define TNWM_GETMINIMUMSIZE
Definition: precomp.h:333
HWND m_hwndPager
Definition: trayntfy.cpp:43
UINT_PTR WPARAM
Definition: windef.h:207
TW_STRUCKRECTS2 sr
Definition: precomp.h:209
int cyBottomHeight
Definition: misc.c:283
SIZE szTrayClockMin
Definition: trayntfy.cpp:46
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
LONG cx
Definition: windef.h:334
LONG_PTR LPARAM
Definition: windef.h:208
#define TRAY_NOTIFY_WND_SPACING_Y
Definition: trayntfy.cpp:31
MARGINS ContentMargin
Definition: trayntfy.cpp:48
int cyTopHeight
Definition: misc.c:282
int cxLeftWidth
Definition: misc.c:280
SIZE szTrayNotify
Definition: trayntfy.cpp:47
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
int cxRightWidth
Definition: misc.c:281
LONG cy
Definition: windef.h:335

Referenced by OnGetMinimumSize().

◆ GetWindow()

HRESULT WINAPI CTrayNotifyWnd::GetWindow ( HWND phwnd)
inline

Implements IOleWindow.

Definition at line 324 of file trayntfy.cpp.

325  {
326  if (!phwnd)
327  return E_INVALIDARG;
328  *phwnd = m_hWnd;
329  return S_OK;
330  }
#define E_INVALIDARG
Definition: ddrawi.h:101
HWND m_hWnd
Definition: atlwin.h:268
#define S_OK
Definition: intsafe.h:59

◆ Initialize()

HRESULT CTrayNotifyWnd::Initialize ( IN HWND  hwndParent)
inline

Definition at line 362 of file trayntfy.cpp.

363  {
365  Create(hwndParent, 0, NULL, dwStyle, WS_EX_STATICEDGE);
366  if (!m_hWnd)
367  return E_FAIL;
368  return S_OK;
369  }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
HWND Create(HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: atlwin.h:1631
#define WS_CHILD
Definition: pedump.c:617
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define E_FAIL
Definition: ddrawi.h:102
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND m_hWnd
Definition: atlwin.h:268
#define S_OK
Definition: intsafe.h:59
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_EX_STATICEDGE
Definition: winuser.h:403

◆ OnClockMessage()

LRESULT CTrayNotifyWnd::OnClockMessage ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 308 of file trayntfy.cpp.

309  {
310  return SendMessageW(m_hwndClock, uMsg, wParam, lParam);
311  }
HWND m_hwndClock
Definition: trayntfy.cpp:42
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPARAM lParam
Definition: combotst.c:139

◆ OnCreate()

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

Definition at line 104 of file trayntfy.cpp.

105  {
106  HRESULT hr;
107 
109  if (FAILED_UNEXPECTEDLY(hr))
110  return FALSE;
111 
113  if (FAILED_UNEXPECTEDLY(hr))
114  return FALSE;
115 
117  if (FAILED_UNEXPECTEDLY(hr))
118  return FALSE;
119 
121  if (FAILED_UNEXPECTEDLY(hr))
122  return FALSE;
123 
124  return TRUE;
125  }
#define TRUE
Definition: types.h:120
HWND m_hwndClock
Definition: trayntfy.cpp:42
HRESULT hr
Definition: shlfolder.c:183
HWND m_hwndPager
Definition: trayntfy.cpp:43
#define IID_PPV_ARG(Itype, ppType)
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1283
HRESULT CTrayClockWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
Definition: trayclock.cpp:750
CComPtr< IUnknown > m_clock
Definition: trayntfy.cpp:39
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
HRESULT CSysPagerWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
Definition: syspager.cpp:1578
HWND m_hWnd
Definition: atlwin.h:268
CComPtr< IUnknown > m_pager
Definition: trayntfy.cpp:40

◆ OnCtxMenu()

LRESULT CTrayNotifyWnd::OnCtxMenu ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 298 of file trayntfy.cpp.

299  {
300  bHandled = TRUE;
301 
302  if (reinterpret_cast<HWND>(wParam) == m_hwndClock)
303  return GetParent().SendMessage(uMsg, wParam, lParam);
304  else
305  return 0;
306  }
#define TRUE
Definition: types.h:120
HWND m_hwndClock
Definition: trayntfy.cpp:42
WPARAM wParam
Definition: combotst.c:138
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
CWindow GetParent() const
Definition: atlwin.h:654
LPARAM lParam
Definition: combotst.c:139

◆ OnEraseBackground()

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

Definition at line 245 of file trayntfy.cpp.

246  {
247  HDC hdc = (HDC) wParam;
248 
249  if (!TrayTheme)
250  {
251  bHandled = FALSE;
252  return 0;
253  }
254 
255  RECT rect;
259 
261 
262  return TRUE;
263  }
#define TRUE
Definition: types.h:120
static HDC
Definition: imagelist.c:92
HTHEME TrayTheme
Definition: trayntfy.cpp:45
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, int iStateId)
Definition: draw.c:1883
BOOL GetClientRect(LPRECT lpRect) const
Definition: atlwin.h:507
HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
Definition: draw.c:72
HDC hdc
Definition: main.c:9
HWND m_hWnd
Definition: atlwin.h:268

◆ OnGetMinimumSize()

LRESULT CTrayNotifyWnd::OnGetMinimumSize ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 265 of file trayntfy.cpp.

266  {
267  BOOL Horizontal = (BOOL) wParam;
268 
269  if (Horizontal != IsHorizontal)
270  {
271  IsHorizontal = Horizontal;
272  if (IsHorizontal)
273  SetWindowTheme(m_hWnd, L"TrayNotifyHoriz", NULL);
274  else
275  SetWindowTheme(m_hWnd, L"TrayNotifyVert", NULL);
276  }
277 
278  return (LRESULT) GetMinimumSize((PSIZE) lParam);
279  }
BOOL IsHorizontal
Definition: trayntfy.cpp:49
#define BOOL
Definition: nt_native.h:43
WPARAM wParam
Definition: combotst.c:138
unsigned int BOOL
Definition: ntddk_ex.h:94
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
smooth NULL
Definition: ftsmooth.c:416
BOOL GetMinimumSize(IN OUT PSIZE pSize)
Definition: trayntfy.cpp:127
static const WCHAR L[]
Definition: oid.c:1250
HWND m_hWnd
Definition: atlwin.h:268
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139

◆ OnNcHitTest()

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

Definition at line 293 of file trayntfy.cpp.

294  {
295  return HTTRANSPARENT;
296  }
#define HTTRANSPARENT
Definition: winuser.h:2448

◆ OnPagerMessage()

LRESULT CTrayNotifyWnd::OnPagerMessage ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 313 of file trayntfy.cpp.

314  {
315  return SendMessageW(m_hwndPager, uMsg, wParam, lParam);
316  }
HWND m_hwndPager
Definition: trayntfy.cpp:43
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPARAM lParam
Definition: combotst.c:139

◆ OnRealign()

LRESULT CTrayNotifyWnd::OnRealign ( INT  uCode,
LPNMHDR  hdr,
BOOL bHandled 
)
inline

Definition at line 318 of file trayntfy.cpp.

319  {
320  hdr->hwndFrom = m_hWnd;
321  return GetParent().SendMessage(WM_NOTIFY, 0, (LPARAM)hdr);
322  }
char hdr[14]
Definition: iptest.cpp:33
LONG_PTR LPARAM
Definition: windef.h:208
HWND m_hWnd
Definition: atlwin.h:268
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
CWindow GetParent() const
Definition: atlwin.h:654
#define WM_NOTIFY
Definition: richedit.h:61

◆ OnSize()

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

Definition at line 281 of file trayntfy.cpp.

282  {
283  SIZE szClient;
284 
285  szClient.cx = LOWORD(lParam);
286  szClient.cy = HIWORD(lParam);
287 
288  Size(&szClient);
289 
290  return TRUE;
291  }
#define TRUE
Definition: types.h:120
VOID Size(IN const SIZE *pszClient)
Definition: trayntfy.cpp:192
LONG cx
Definition: windef.h:334
#define HIWORD(l)
Definition: typedefs.h:246
LONG cy
Definition: windef.h:335
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

◆ OnThemeChanged() [1/2]

LRESULT CTrayNotifyWnd::OnThemeChanged ( )
inline

Definition at line 64 of file trayntfy.cpp.

65  {
66  if (TrayTheme)
68 
69  if (IsThemeActive())
70  TrayTheme = OpenThemeData(m_hWnd, L"TrayNotify");
71  else
72  TrayTheme = NULL;
73 
74  if (TrayTheme)
75  {
77 
79  NULL,
81  0,
83  NULL,
84  &ContentMargin);
85  }
86  else
87  {
89 
94  }
95 
96  return TRUE;
97  }
#define TRUE
Definition: types.h:120
HTHEME TrayTheme
Definition: trayntfy.cpp:45
#define TMT_CONTENTMARGINS
Definition: vssym32.h:324
int cyBottomHeight
Definition: misc.c:283
smooth NULL
Definition: ftsmooth.c:416
MARGINS ContentMargin
Definition: trayntfy.cpp:48
int cyTopHeight
Definition: misc.c:282
int cxLeftWidth
Definition: misc.c:280
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:835
#define SetWindowExStyle(h, val)
Definition: utility.h:154
static const WCHAR L[]
Definition: oid.c:1250
HWND m_hWnd
Definition: atlwin.h:268
HRESULT WINAPI GetThemeMargins(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, RECT *prc, MARGINS *pMargins)
Definition: property.c:216
BOOL WINAPI IsThemeActive(void)
Definition: system.c:606
int cxRightWidth
Definition: misc.c:281
#define WS_EX_STATICEDGE
Definition: winuser.h:403
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:950

Referenced by OnThemeChanged().

◆ OnThemeChanged() [2/2]

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

Definition at line 99 of file trayntfy.cpp.

100  {
101  return OnThemeChanged();
102  }
LRESULT OnThemeChanged()
Definition: trayntfy.cpp:64

◆ Size()

VOID CTrayNotifyWnd::Size ( IN const SIZE pszClient)
inline

Definition at line 192 of file trayntfy.cpp.

193  {
195  {
196  POINT ptClock;
197  SIZE szClock;
198 
199  if (IsHorizontal)
200  {
201  ptClock.x = pszClient->cx - szTrayClockMin.cx - ContentMargin.cxRightWidth;
202  ptClock.y = ContentMargin.cyTopHeight;
203  szClock.cx = szTrayClockMin.cx;
204  szClock.cy = pszClient->cy - ContentMargin.cyTopHeight - ContentMargin.cyBottomHeight;
205  }
206  else
207  {
208  ptClock.x = ContentMargin.cxLeftWidth;
209  ptClock.y = pszClient->cy - szTrayClockMin.cy;
210  szClock.cx = pszClient->cx - ContentMargin.cxLeftWidth - ContentMargin.cxRightWidth;
211  szClock.cy = szTrayClockMin.cy;
212  }
213 
215  NULL,
216  ptClock.x,
217  ptClock.y,
218  szClock.cx,
219  szClock.cy,
220  SWP_NOZORDER);
221  }
222 
223  POINT ptPager;
224 
225  if (IsHorizontal)
226  {
227  ptPager.x = ContentMargin.cxLeftWidth;
228  ptPager.y = (pszClient->cy - szTrayNotify.cy)/2;
229  }
230  else
231  {
232  ptPager.x = (pszClient->cx - szTrayNotify.cx)/2;
233  ptPager.y = ContentMargin.cyTopHeight;
234  }
235 
237  NULL,
238  ptPager.x,
239  ptPager.y,
242  SWP_NOZORDER);
243  }
DWORD HideClock
Definition: precomp.h:195
HWND m_hwndClock
Definition: trayntfy.cpp:42
long y
Definition: polytest.cpp:48
BOOL IsHorizontal
Definition: trayntfy.cpp:49
long x
Definition: polytest.cpp:48
BOOL SetWindowPos(HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
Definition: atlwin.h:1220
HWND m_hwndPager
Definition: trayntfy.cpp:43
#define SWP_NOZORDER
Definition: winuser.h:1232
TW_STRUCKRECTS2 sr
Definition: precomp.h:209
int cyBottomHeight
Definition: misc.c:283
SIZE szTrayClockMin
Definition: trayntfy.cpp:46
smooth NULL
Definition: ftsmooth.c:416
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
LONG cx
Definition: windef.h:334
MARGINS ContentMargin
Definition: trayntfy.cpp:48
int cyTopHeight
Definition: misc.c:282
int cxLeftWidth
Definition: misc.c:280
SIZE szTrayNotify
Definition: trayntfy.cpp:47
int cxRightWidth
Definition: misc.c:281
LONG cy
Definition: windef.h:335

Referenced by OnSize().

Member Data Documentation

◆ ContentMargin

MARGINS CTrayNotifyWnd::ContentMargin
private

Definition at line 48 of file trayntfy.cpp.

Referenced by CTrayNotifyWnd(), GetMinimumSize(), OnThemeChanged(), and Size().

◆ IsHorizontal

BOOL CTrayNotifyWnd::IsHorizontal
private

Definition at line 49 of file trayntfy.cpp.

Referenced by GetMinimumSize(), OnGetMinimumSize(), and Size().

◆ m_clock

CComPtr<IUnknown> CTrayNotifyWnd::m_clock
private

Definition at line 39 of file trayntfy.cpp.

Referenced by OnCreate().

◆ m_hwndClock

HWND CTrayNotifyWnd::m_hwndClock
private

Definition at line 42 of file trayntfy.cpp.

Referenced by GetMinimumSize(), OnClockMessage(), OnCreate(), OnCtxMenu(), and Size().

◆ m_hwndPager

HWND CTrayNotifyWnd::m_hwndPager
private

Definition at line 43 of file trayntfy.cpp.

Referenced by GetMinimumSize(), OnCreate(), OnPagerMessage(), and Size().

◆ m_pager

CComPtr<IUnknown> CTrayNotifyWnd::m_pager
private

Definition at line 40 of file trayntfy.cpp.

Referenced by OnCreate().

◆ szTrayClockMin

SIZE CTrayNotifyWnd::szTrayClockMin
private

Definition at line 46 of file trayntfy.cpp.

Referenced by CTrayNotifyWnd(), GetMinimumSize(), and Size().

◆ szTrayNotify

SIZE CTrayNotifyWnd::szTrayNotify
private

Definition at line 47 of file trayntfy.cpp.

Referenced by CTrayNotifyWnd(), GetMinimumSize(), and Size().

◆ TrayTheme

HTHEME CTrayNotifyWnd::TrayTheme
private

Definition at line 45 of file trayntfy.cpp.

Referenced by OnEraseBackground(), and OnThemeChanged().


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