ReactOS 0.4.15-dev-5896-g3f5bcf5
trayclock.cpp
Go to the documentation of this file.
1/*
2 * ReactOS Explorer
3 *
4 * Copyright 2006 - 2007 Thomas Weidenmueller <w3seek@reactos.org>
5 * Copyright 2018 Ged Murphy <gedmurphy@reactos.org>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#include "precomp.h"
23
24/*
25 * TrayClockWnd
26 */
27
28const struct
29{
33} ClockWndFormats[] = {
34 { TRUE, 0, NULL },
35 { FALSE, 0, L"dddd" },
37};
39
40#define CLOCKWND_FORMAT_COUNT ClockWndFormatsCount
41
42static const WCHAR szTrayClockWndClass[] = L"TrayClockWClass";
43
45 public CComCoClass<CTrayClockWnd>,
46 public CComObjectRootEx<CComMultiThreadModelNoCS>,
47 public CWindowImpl < CTrayClockWnd, CWindow, CControlWinTraits >,
48 public IOleWindow
49{
55
56 union
57 {
59 struct
60 {
65 };
66 };
72
73public:
75 virtual ~CTrayClockWnd();
76
77private:
80
82 WORD GetMinimumSize(IN BOOL Horizontal, IN OUT PSIZE pSize);
84 VOID Update();
89 LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
90 VOID SetFont(IN HFONT hNewFont, IN BOOL bRedraw);
93 LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
98 LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
101
102public:
103
105 {
106 if (!phwnd)
107 return E_INVALIDARG;
108 *phwnd = m_hWnd;
109 return S_OK;
110 }
111
113 {
114 return E_NOTIMPL;
115 }
116
118
123
125
133 MESSAGE_HANDLER(WM_THEMECHANGED, OnThemeChanged)
141
143};
144
145#define ID_TRAYCLOCK_TIMER 0
146#define ID_TRAYCLOCK_TIMER_INIT 1
147
148#define TRAY_CLOCK_WND_SPACING_X 5
149#define TRAY_CLOCK_WND_SPACING_Y 0
150
152 hFont(NULL),
153 textColor(0),
154 dwFlags(0),
155 LineSpacing(0),
156 VisibleLines(0)
157{
158 ZeroMemory(&rcText, sizeof(rcText));
159 ZeroMemory(&LocalTime, sizeof(LocalTime));
162 ZeroMemory(szLines, sizeof(szLines));
163}
165
167{
168 LOGFONTW clockFont;
169 HTHEME clockTheme;
170 HFONT hFont;
171
172 clockTheme = OpenThemeData(m_hWnd, L"Clock");
173
174 if (clockTheme)
175 {
176 GetThemeFont(clockTheme, NULL, CLP_TIME, 0, TMT_FONT, &clockFont);
177
178 hFont = CreateFontIndirectW(&clockFont);
179
181
182 if (this->hFont != NULL)
183 DeleteObject(this->hFont);
184
186
187 CloseThemeData(clockTheme);
188 }
189
190 return TRUE;
191}
192
194{
195 return OnThemeChanged();
196}
197
199{
200 HDC hDC;
201 HFONT hPrevFont;
202 UINT c, i;
203 BOOL bRet = TRUE;
204
205 hDC = GetDC();
206 if (hDC != NULL)
207 {
208 if (hFont)
209 hPrevFont = (HFONT) SelectObject(hDC, hFont);
210
211 for (i = 0; i < CLOCKWND_FORMAT_COUNT && bRet; i++)
212 {
213 if (szLines[i][0] != L'\0' &&
215 &LineSizes[i]))
216 {
217 bRet = FALSE;
218 break;
219 }
220 }
221
222 if (hFont)
223 SelectObject(hDC, hPrevFont);
224
225 ReleaseDC(hDC);
226
227 if (bRet)
228 {
229 LineSpacing = 0;
230
231 /* calculate the line spacing */
232 for (i = 0, c = 0; i < CLOCKWND_FORMAT_COUNT; i++)
233 {
234 if (LineSizes[i].cx > 0)
235 {
237 c++;
238 }
239 }
240
241 if (c > 0)
242 {
243 /* We want a spacing of 1/2 line */
244 LineSpacing = (LineSpacing / c) / 2;
245 }
246
247 return TRUE;
248 }
249 }
250
251 return FALSE;
252}
253
255{
256 WORD iLinesVisible = 0;
257 UINT i;
258 SIZE szMax = { 0, 0 };
259
260 if (!LinesMeasured)
262
263 if (!LinesMeasured)
264 return 0;
265
266 for (i = 0; i < CLOCKWND_FORMAT_COUNT; i++)
267 {
268 if (LineSizes[i].cx != 0)
269 {
270 if (iLinesVisible > 0)
271 {
272 if (Horizontal)
273 {
274 if (szMax.cy + LineSizes[i].cy + (LONG) LineSpacing >
275 pSize->cy - (2 * TRAY_CLOCK_WND_SPACING_Y))
276 {
277 break;
278 }
279 }
280 else
281 {
282 if (LineSizes[i].cx > pSize->cx - (2 * TRAY_CLOCK_WND_SPACING_X))
283 break;
284 }
285
286 /* Add line spacing */
287 szMax.cy += LineSpacing;
288 }
289
290 iLinesVisible++;
291
292 /* Increase maximum rectangle */
293 szMax.cy += LineSizes[i].cy;
294 if (LineSizes[i].cx > szMax.cx)
295 szMax.cx = LineSizes[i].cx;
296 }
297 }
298
299 szMax.cx += 2 * TRAY_CLOCK_WND_SPACING_X;
300 szMax.cy += 2 * TRAY_CLOCK_WND_SPACING_Y;
301
302 *pSize = szMax;
303
304 return iLinesVisible;
305}
306
308{
309 SIZE szPrevCurrent;
310 UINT BufSize, i;
311 INT iRet;
312 RECT rcClient;
313
315
316 szPrevCurrent = CurrentSize;
317
318 for (i = 0; i < CLOCKWND_FORMAT_COUNT; i++)
319 {
320 szLines[i][0] = L'\0';
322
324 {
327 &LocalTime,
328 ClockWndFormats[i].lpFormat,
329 szLines[i],
330 BufSize);
331 }
332 else
333 {
336 &LocalTime,
338 szLines[i],
339 BufSize);
340 }
341
342 if (iRet != 0 && i == 0)
343 {
344 /* Set the window text to the time only */
346 }
347 }
348
350
351 if (LinesMeasured &&
352 GetClientRect(&rcClient))
353 {
354 SIZE szWnd;
355
356 szWnd.cx = rcClient.right;
357 szWnd.cy = rcClient.bottom;
358
360 CurrentSize = szWnd;
361 }
362
363 if (IsWindowVisible())
364 {
366
367 if (szPrevCurrent.cx != CurrentSize.cx ||
368 szPrevCurrent.cy != CurrentSize.cy)
369 {
370 /* Ask the parent to resize */
371 NMHDR nmh = {GetParent(), 0, NTNWM_REALIGN};
373 }
374 }
375
376 int iDateLength = GetDateFormat(LOCALE_USER_DEFAULT,
378 &LocalTime,
379 NULL,
380 NULL,
381 0);
382 if (iDateLength <= 0)
383 {
384 return;
385 }
386
387 WCHAR* szDate = new WCHAR[iDateLength];
390 &LocalTime,
391 NULL,
392 szDate,
393 iDateLength) > 0)
394 {
396 reinterpret_cast<UINT_PTR>(m_hWnd),
397 szDate);
398 }
399 delete[] szDate;
400}
401
403{
405 UpdateWnd();
406}
407
409{
410 UINT uiDueTime;
411
413 uiDueTime = 1000 - (UINT) LocalTime.wMilliseconds;
415 uiDueTime += (59 - (UINT) LocalTime.wSecond) * 1000;
416
417 return uiDueTime;
418}
419
421{
422 UINT uiDueTime;
423 BOOL Ret;
424
425 /* Disable all timers */
426 if (IsTimerEnabled)
427 {
430 }
431 else if (IsInitTimerEnabled)
432 {
434 }
435
436 uiDueTime = CalculateDueTime();
437
438 /* Set the new timer */
439 Ret = SetTimer(ID_TRAYCLOCK_TIMER_INIT, uiDueTime, NULL) != 0;
440 IsInitTimerEnabled = Ret;
441
442 return Ret;
443}
444
446{
447 UINT uiDueTime;
448 BOOL Ret;
449 UINT uiWait1, uiWait2;
450
451 /* Kill the initialization timer */
454
455 uiDueTime = CalculateDueTime();
456
458 {
459 uiWait1 = 1000 - 200;
460 uiWait2 = 1000;
461 }
462 else
463 {
464 uiWait1 = 60 * 1000 - 200;
465 uiWait2 = 60 * 1000;
466 }
467
468 if (uiDueTime > uiWait1)
469 {
470 /* The update of the clock will be up to 200 ms late, but that's
471 acceptable. We're going to setup a timer that fires depending
472 uiWait2. */
473 Ret = SetTimer(ID_TRAYCLOCK_TIMER, uiWait2, NULL) != 0;
474 IsTimerEnabled = Ret;
475 }
476 else
477 {
478 /* Recalibrate the timer and recalculate again when the current
479 minute/second ends. */
480 ResetTime();
481 }
482
483 /* Update the time */
484 Update();
485}
486
488{
489 /* Disable all timers */
490 if (IsTimerEnabled)
491 {
493 }
494 else if (IsInitTimerEnabled)
495 {
497 }
498
499 return TRUE;
500}
501
503{
504 RECT rcClient;
505 HFONT hPrevFont;
506 INT iPrevBkMode;
507 UINT i, line;
508 PAINTSTRUCT ps;
509 HDC hDC = (HDC) wParam;
510
511 if (wParam == 0)
512 hDC = BeginPaint(&ps);
513
514 if (hDC == NULL)
515 return FALSE;
516
517 if (LinesMeasured &&
518 GetClientRect(&rcClient))
519 {
520 iPrevBkMode = SetBkMode(hDC, TRANSPARENT);
521
522 if (!IsAppThemed())
524
526
527 hPrevFont = (HFONT) SelectObject(hDC, hFont);
528
529 rcClient.top = (rcClient.bottom - CurrentSize.cy) / 2;
530 rcClient.bottom = rcClient.top + CurrentSize.cy;
531
532 for (i = 0, line = 0;
534 i++)
535 {
536 if (LineSizes[i].cx != 0)
537 {
538 TextOut(hDC,
539 (rcClient.right - LineSizes[i].cx) / 2,
540 rcClient.top + TRAY_CLOCK_WND_SPACING_Y,
541 szLines[i],
542 wcslen(szLines[i]));
543
544 rcClient.top += LineSizes[i].cy + LineSpacing;
545 line++;
546 }
547 }
548
549 SelectObject(hDC, hPrevFont);
550
551 SetBkMode(hDC, iPrevBkMode);
552 }
553
554 if (wParam == 0)
555 EndPaint(&ps);
556
557 return TRUE;
558}
559
561{
562 hFont = hNewFont;
564 if (bRedraw)
565 {
567 }
568}
569
571{
572 RECT rect;
573
576
577 return TRUE;
578}
579
581{
582 HDC hdc = (HDC) wParam;
583
584 if (!IsAppThemed())
585 {
586 bHandled = FALSE;
587 return 0;
588 }
589
590 return DrawBackground(hdc);
591}
592
594{
595 switch (wParam)
596 {
598 Update();
599 break;
600
603 break;
604 }
605 return TRUE;
606}
607
609{
611
612 return (LRESULT) GetMinimumSize((BOOL) wParam, (PSIZE) lParam) != 0;
613}
614
616{
617 return GetParent().SendMessage(uMsg, wParam, lParam);
618}
619
621{
623 return TRUE;
624}
625
627{
629
630 TOOLINFOW ti = { 0 };
631 ti.cbSize = TTTOOLINFOW_V1_SIZE;
632 ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
633 ti.hwnd = m_hWnd;
634 ti.uId = reinterpret_cast<UINT_PTR>(m_hWnd);
635 ti.lpszText = NULL;
636 ti.lParam = NULL;
637
638 m_tooltip.AddTool(&ti);
639
641 {
642 ResetTime();
643 }
644
645 /* Update the time */
646 Update();
647
648 return TRUE;
649}
650
652{
653 SIZE szClient;
654
655 szClient.cx = LOWORD(lParam);
656 szClient.cy = HIWORD(lParam);
657
659 CurrentSize = szClient;
660
662 return TRUE;
663}
664
666{
667 BOOL bRealign = FALSE;
668
669 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
670 if (newSettings->bShowSeconds != g_TaskbarSettings.bShowSeconds)
671 {
674 {
675 bRealign = TRUE;
676
677 ResetTime();
678 }
679 }
680
681 if (newSettings->sr.HideClock != g_TaskbarSettings.sr.HideClock)
682 {
685 bRealign = TRUE;
686
688 {
689 /* Disable all timers */
690 if (IsTimerEnabled)
691 {
694 }
695 else if (IsInitTimerEnabled)
696 {
699 }
700 }
701 else
702 {
703 ResetTime();
704 }
705 }
706
707 if (bRealign)
708 {
709 /* Ask the parent to resize */
710 NMHDR nmh = {GetParent(), 0, NTNWM_REALIGN};
712 Update();
713 }
714 return 0;
715}
716
718{
719 if (IsWindowVisible())
720 {
721 //FIXME: use SHRunControlPanel
722 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
723 }
724 return TRUE;
725}
726
728{
730
731 /* Create the window. The tray window is going to move it to the correct
732 position and resize it as needed. */
733 DWORD dwStyle = WS_CHILD | WS_CLIPSIBLINGS;
735 dwStyle |= WS_VISIBLE;
736
737 Create(hWndParent, 0, NULL, dwStyle);
738 if (!m_hWnd)
739 return E_FAIL;
740
741 SetWindowTheme(m_hWnd, L"TrayNotify", NULL);
742
743 return S_OK;
744
745};
746
748{
749 return ShellObjectCreatorInit<CTrayClockWnd>(hwndParent, riid, ppv);
750}
static HDC hDC
Definition: 3dtext.c:33
#define BufSize
Definition: FsRtlTunnel.c:28
@ Create
Definition: registry.c:563
#define TNWM_GETMINIMUMSIZE
Definition: precomp.h:333
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
#define TWM_SETTINGSCHANGED
Definition: precomp.h:132
#define NTNWM_REALIGN
Definition: precomp.h:336
HDC GetDC()
Definition: atlwin.h:541
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1110
CWindow GetParent() const
Definition: atlwin.h:694
BOOL IsWindowVisible() const
Definition: atlwin.h:952
HWND m_hWnd
Definition: atlwin.h:267
BOOL AddTool(IN CONST TTTOOLINFOW *pInfo)
Definition: rosctrls.h:637
VOID UpdateTipText(IN HWND hwndToolOwner, IN UINT uId, IN PCWSTR szText, IN HINSTANCE hinstResourceOwner=NULL)
Definition: rosctrls.h:685
HWND Create(HWND hWndParent, DWORD dwStyles=WS_POPUP|TTS_NOPREFIX, DWORD dwExStyles=WS_EX_TOPMOST)
Definition: rosctrls.h:616
LRESULT OnLButtonDblClick(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:717
SIZE CurrentSize
Definition: trayclock.cpp:68
WORD VisibleLines
Definition: trayclock.cpp:69
CTooltips m_tooltip
Definition: trayclock.cpp:54
LRESULT OnThemeChanged()
Definition: trayclock.cpp:166
BOOL MeasureLines()
Definition: trayclock.cpp:198
LRESULT DrawBackground(HDC hdc)
Definition: trayclock.cpp:570
DWORD LinesMeasured
Definition: trayclock.cpp:63
HRESULT Initialize(IN HWND hWndParent)
Definition: trayclock.cpp:727
DWORD LineSpacing
Definition: trayclock.cpp:67
VOID CalibrateTimer()
Definition: trayclock.cpp:445
COLORREF textColor
Definition: trayclock.cpp:51
VOID UpdateWnd()
Definition: trayclock.cpp:307
DWORD IsTimerEnabled
Definition: trayclock.cpp:61
UINT CalculateDueTime()
Definition: trayclock.cpp:408
LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:615
DWORD IsHorizontal
Definition: trayclock.cpp:64
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:580
WCHAR szLines[CLOCKWND_FORMAT_COUNT][48]
Definition: trayclock.cpp:71
SYSTEMTIME LocalTime
Definition: trayclock.cpp:53
virtual ~CTrayClockWnd()
Definition: trayclock.cpp:164
LRESULT OnTaskbarSettingsChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:665
VOID SetFont(IN HFONT hNewFont, IN BOOL bRedraw)
Definition: trayclock.cpp:560
LRESULT OnSetFont(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:620
BOOL ResetTime()
Definition: trayclock.cpp:420
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:626
SIZE LineSizes[CLOCKWND_FORMAT_COUNT]
Definition: trayclock.cpp:70
LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:502
HRESULT WINAPI GetWindow(HWND *phwnd)
Definition: trayclock.cpp:104
WORD GetMinimumSize(IN BOOL Horizontal, IN OUT PSIZE pSize)
Definition: trayclock.cpp:254
LRESULT OnGetMinimumSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:608
HRESULT WINAPI ContextSensitiveHelp(BOOL fEnterMode)
Definition: trayclock.cpp:112
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:593
DWORD IsInitTimerEnabled
Definition: trayclock.cpp:62
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:651
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:487
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static HWND hwndParent
Definition: cryptui.c:300
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
Definition: draw.c:72
HRESULT WINAPI GetThemeFont(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, LOGFONTW *pFont)
Definition: property.c:108
HRESULT WINAPI GetThemeColor(HTHEME hTheme, int iPartId, int iStateId, int iPropId, COLORREF *pColor)
Definition: property.c:45
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:835
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:950
BOOL WINAPI IsAppThemed(void)
Definition: system.c:596
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
pKey DeleteObject()
const GLubyte * c
Definition: glext.h:8905
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
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define c
Definition: ke_i.h:80
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:542
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:562
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:640
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:612
#define END_COM_MAP()
Definition: atlcom.h:553
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1920
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1892
#define END_MSG_MAP()
Definition: atlwin.h:1911
#define DECLARE_WND_CLASS_EX(WndClassName, style, bkgnd)
Definition: atlwin.h:1998
if(dx< 0)
Definition: linetemp.h:194
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
#define BOOL
Definition: nt_native.h:43
#define _ARRAYSIZE(A)
Definition: ntbasedef.h:701
#define LOCALE_USER_DEFAULT
#define L(x)
Definition: ntvdm.h:50
const GUID IID_IOleWindow
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_POPUP
Definition: pedump.c:616
#define WS_VISIBLE
Definition: pedump.c:620
long LONG
Definition: pedump.c:60
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define TOOLINFOW
Definition: commctrl.h:1715
_Out_opt_ int * cx
Definition: commctrl.h:585
#define TTTOOLINFOW_V1_SIZE
Definition: commctrl.h:1721
#define TTF_IDISHWND
Definition: commctrl.h:1764
#define TTF_SUBCLASS
Definition: commctrl.h:1767
#define TTS_ALWAYSTIP
Definition: commctrl.h:1757
#define TTS_NOPREFIX
Definition: commctrl.h:1758
#define REFIID
Definition: guiddef.h:118
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_PRINTCLIENT
Definition: richedit.h:70
#define WM_NOTIFY
Definition: richedit.h:61
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2346
#define _countof(array)
Definition: sndvol32.h:68
& rect
Definition: startmenu.cpp:1413
TW_STRUCKRECTS2 sr
Definition: precomp.h:209
BOOL bShowSeconds
Definition: precomp.h:207
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
WORD wMilliseconds
Definition: winbase.h:912
WORD wSecond
Definition: winbase.h:911
DWORD HideClock
Definition: precomp.h:195
Definition: parser.c:49
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
HRESULT CTrayClockWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
Definition: trayclock.cpp:747
const UINT ClockWndFormatsCount
Definition: trayclock.cpp:38
#define CLOCKWND_FORMAT_COUNT
Definition: trayclock.cpp:40
#define TRAY_CLOCK_WND_SPACING_Y
Definition: trayclock.cpp:149
#define TRAY_CLOCK_WND_SPACING_X
Definition: trayclock.cpp:148
static const WCHAR szTrayClockWndClass[]
Definition: trayclock.cpp:42
const struct @84 ClockWndFormats[]
DWORD dwFormatFlags
Definition: trayclock.cpp:31
LPCWSTR lpFormat
Definition: trayclock.cpp:32
BOOL IsTime
Definition: trayclock.cpp:30
#define ID_TRAYCLOCK_TIMER
Definition: trayclock.cpp:145
#define ID_TRAYCLOCK_TIMER_INIT
Definition: trayclock.cpp:146
int32_t INT
Definition: typedefs.h:58
#define IN
Definition: typedefs.h:39
#define HIWORD(l)
Definition: typedefs.h:247
#define OUT
Definition: typedefs.h:40
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
#define TMT_TEXTCOLOR
Definition: vssym32.h:328
@ CLP_TIME
Definition: vssym32.h:526
#define TMT_FONT
Definition: vssym32.h:144
#define ZeroMemory
Definition: winbase.h:1670
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
DWORD COLORREF
Definition: windef.h:300
#define WINAPI
Definition: msvc.h:6
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
#define TRANSPARENT
Definition: wingdi.h:950
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
#define TextOut
Definition: wingdi.h:4483
#define GetTimeFormat
Definition: winnls.h:1189
#define TIME_NOSECONDS
Definition: winnls.h:278
#define DATE_LONGDATE
Definition: winnls.h:197
#define GetDateFormat
Definition: winnls.h:1184
#define DATE_SHORTDATE
Definition: winnls.h:196
#define WM_PAINT
Definition: winuser.h:1610
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1615
DWORD WINAPI GetSysColor(_In_ int)
#define SW_HIDE
Definition: winuser.h:762
#define COLOR_BTNTEXT
Definition: winuser.h:927
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WM_CREATE
Definition: winuser.h:1598
#define WM_SIZE
Definition: winuser.h:1601
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1768
#define CS_DBLCLKS
Definition: winuser.h:646
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WM_SETFONT
Definition: winuser.h:1640
#define WM_TIMER
Definition: winuser.h:1732
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define SW_SHOW
Definition: winuser.h:769
#define WM_DESTROY
Definition: winuser.h:1599
#define SetWindowText
Definition: winuser.h:5847
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SW_NORMAL
Definition: winuser.h:763
#define COLOR_3DFACE
Definition: winuser.h:923
static void Initialize()
Definition: xlate.c:212
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185