23#include <commoncontrols.h>
27#define TRAY_NOTIFY_WND_SPACING_X 1
28#define TRAY_NOTIFY_WND_SPACING_Y 1
29#define CLOCK_TEXT_HACK 4
38 public CWindowImpl < CTrayNotifyWnd, CWindow, CControlWinTraits >,
139 SIZE clockSize = { 0, 0 };
140 SIZE traySize = { 0, 0 };
141 SIZE showDesktopSize = { 0, 0 };
147 clockSize.
cy = pSize->cy;
148 if (clockSize.
cy <= 0)
153 clockSize.
cx = pSize->cx;
154 if (clockSize.
cx <= 0)
179 INT showDesktopButtonExtent = 0;
185 showDesktopSize.
cx = showDesktopButtonExtent;
186 showDesktopSize.
cy = pSize->cy;
190 showDesktopSize.
cx = pSize->cx;
191 showDesktopSize.
cy = showDesktopButtonExtent;
204 pSize->cx += showDesktopButtonExtent;
206 pSize->cx += traySize.
cx;
217 pSize->cy += showDesktopButtonExtent;
219 pSize->cy += traySize.
cy;
228 RECT rcClient = {0, 0, pszClient->cx, pszClient->cy};
230 pszClient->cx = rcClient.
right - rcClient.
left;
231 pszClient->cy = rcClient.
bottom - rcClient.
top;
237 if (prcClient !=
NULL)
238 rcClient = *prcClient;
251 POINT ptShowDesktop =
256 SIZE showDesktopSize =
273 ptShowDesktop.
x = rcClient.
right;
274 showDesktopSize.
cx = cxyShowDesktop;
289 ptShowDesktop.
y = rcClient.
bottom;
290 showDesktopSize.
cy = cxyShowDesktop;
315 ptClock.
x = rcClient.
right;
359 if (prcClient !=
NULL)
HRESULT CTrayClockWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
HRESULT CSysPagerWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
#define TNWM_GETMINIMUMSIZE
TaskbarSettings g_TaskbarSettings
#define TWM_SETTINGSCHANGED
#define TNWM_GETSHOWDESKTOPBUTTON
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
CWindow GetParent() const
LRESULT OnRealign(INT uCode, LPNMHDR hdr, BOOL &bHandled)
HRESULT WINAPI GetWindow(HWND *phwnd)
CComPtr< IUnknown > m_pager
VOID Size(IN OUT SIZE *pszClient)
LRESULT OnClockMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
BOOL GetMinimumSize(IN OUT PSIZE pSize)
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnPagerMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnGetMinimumSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
CComPtr< IUnknown > m_clock
LRESULT OnTaskbarSettingsChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnCtxMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
HRESULT Initialize(IN HWND hwndParent)
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnThemeChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
VOID AlignControls(IN CONST PRECT prcClient OPTIONAL)
LRESULT OnGetShowDesktopButton(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
CTrayShowDesktopButton m_ShowDesktopButton
HRESULT WINAPI ContextSensitiveHelp(BOOL fEnterMode)
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
#define FAILED_UNEXPECTEDLY(hr)
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, int iStateId)
HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
HRESULT WINAPI GetThemeMargins(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, RECT *prc, MARGINS *pMargins)
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
BOOL WINAPI IsThemeActive(void)
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
#define COM_INTERFACE_ENTRY_IID(iid, x)
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
#define DECLARE_NOT_AGGREGATABLE(x)
#define MESSAGE_HANDLER(msg, func)
#define NOTIFY_CODE_HANDLER(cd, func)
#define BEGIN_MSG_MAP(theClass)
#define DECLARE_WND_CLASS_EX(WndClassName, style, bkgnd)
#define SetWindowExStyle(h, val)
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
const GUID IID_IOleWindow
PULONG MinorVersion OPTIONAL
BOOL UseCompactTrayIcons()
static const WCHAR szTrayNotifyWndClass[]
#define TRAY_NOTIFY_WND_SPACING_Y
#define TRAY_NOTIFY_WND_SPACING_X
HRESULT CTrayNotifyWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
#define TMT_CONTENTMARGINS
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
#define WM_NCLBUTTONDBLCLK
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IID_PPV_ARG(Itype, ppType)