ReactOS 0.4.15-dev-8207-gd73a838
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#define CLOCKWND_FORMAT_TIME 0
42#define CLOCKWND_FORMAT_DAY 1
43#define CLOCKWND_FORMAT_DATE 2
44
45static const WCHAR szTrayClockWndClass[] = L"TrayClockWClass";
46
48 public CComCoClass<CTrayClockWnd>,
49 public CComObjectRootEx<CComMultiThreadModelNoCS>,
50 public CWindowImpl < CTrayClockWnd, CWindow, CControlWinTraits >,
51 public IOleWindow
52{
58
59 union
60 {
62 struct
63 {
68 };
69 };
75
76public:
78 virtual ~CTrayClockWnd();
79
80private:
83
85 WORD GetMinimumSize(IN BOOL Horizontal, IN OUT PSIZE pSize);
87 VOID Update();
92 LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
93 VOID SetFont(IN HFONT hNewFont, IN BOOL bRedraw);
96 LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
100 LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
101 LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
104 VOID PaintLine(IN HDC hDC, IN OUT RECT *rcClient, IN UINT LineNumber, IN UINT szLinesIndex);
105
106public:
107
109 {
110 if (!phwnd)
111 return E_INVALIDARG;
112 *phwnd = m_hWnd;
113 return S_OK;
114 }
115
117 {
118 return E_NOTIMPL;
119 }
120
122
127
129
137 MESSAGE_HANDLER(WM_THEMECHANGED, OnThemeChanged)
145
147};
148
149#define ID_TRAYCLOCK_TIMER 0
150#define ID_TRAYCLOCK_TIMER_INIT 1
151
152#define TRAY_CLOCK_WND_SPACING_X 5
153#define TRAY_CLOCK_WND_SPACING_Y 0
154
156 hFont(NULL),
157 textColor(0),
158 dwFlags(0),
159 LineSpacing(0),
160 VisibleLines(0)
161{
162 ZeroMemory(&rcText, sizeof(rcText));
163 ZeroMemory(&LocalTime, sizeof(LocalTime));
166 ZeroMemory(szLines, sizeof(szLines));
167}
169
171{
172 LOGFONTW clockFont;
173 HTHEME clockTheme;
174 HFONT hFont;
175
176 clockTheme = OpenThemeData(m_hWnd, L"Clock");
177
178 if (clockTheme)
179 {
180 GetThemeFont(clockTheme, NULL, CLP_TIME, 0, TMT_FONT, &clockFont);
181
182 hFont = CreateFontIndirectW(&clockFont);
183
185
186 if (this->hFont != NULL)
187 DeleteObject(this->hFont);
188
190
191 CloseThemeData(clockTheme);
192 }
193
194 return TRUE;
195}
196
198{
199 return OnThemeChanged();
200}
201
203{
204 HDC hDC;
205 HFONT hPrevFont;
206 UINT c, i;
207 BOOL bRet = TRUE;
208
209 hDC = GetDC();
210 if (hDC != NULL)
211 {
212 if (hFont)
213 hPrevFont = (HFONT) SelectObject(hDC, hFont);
214
215 for (i = 0; i < CLOCKWND_FORMAT_COUNT && bRet; i++)
216 {
217 if (szLines[i][0] != L'\0' &&
219 &LineSizes[i]))
220 {
221 bRet = FALSE;
222 break;
223 }
224 }
225
226 if (hFont)
227 SelectObject(hDC, hPrevFont);
228
229 ReleaseDC(hDC);
230
231 if (bRet)
232 {
233 LineSpacing = 0;
234
235 /* calculate the line spacing */
236 for (i = 0, c = 0; i < CLOCKWND_FORMAT_COUNT; i++)
237 {
238 if (LineSizes[i].cx > 0)
239 {
241 c++;
242 }
243 }
244
245 if (c > 0)
246 {
247 /* We want a spacing of 1/2 line */
248 LineSpacing = (LineSpacing / c) / 2;
249 }
250
251 return TRUE;
252 }
253 }
254
255 return FALSE;
256}
257
259{
260 WORD iLinesVisible = 0;
261 UINT i;
262 SIZE szMax = { 0, 0 };
263
264 if (!LinesMeasured)
266
267 if (!LinesMeasured)
268 return 0;
269
270 /* Prevents the date from being cut off when the day of the week is shorter than the date. */
273
274 for (i = 0; i < CLOCKWND_FORMAT_COUNT; i++)
275 {
276 if (LineSizes[i].cx != 0)
277 {
278 if (iLinesVisible > 0)
279 {
280 if (Horizontal)
281 {
282 if (szMax.cy + LineSizes[i].cy + (LONG) LineSpacing >
283 pSize->cy - (2 * TRAY_CLOCK_WND_SPACING_Y))
284 {
285 break;
286 }
287 }
288 else
289 {
290 if (LineSizes[i].cx > pSize->cx - (2 * TRAY_CLOCK_WND_SPACING_X))
291 break;
292 }
293
294 /* Add line spacing */
295 szMax.cy += LineSpacing;
296 }
297
298 iLinesVisible++;
299
300 /* Increase maximum rectangle */
301 szMax.cy += LineSizes[i].cy;
302 if (LineSizes[i].cx > szMax.cx)
303 szMax.cx = LineSizes[i].cx;
304 }
305 }
306
307 szMax.cx += 2 * TRAY_CLOCK_WND_SPACING_X;
308 szMax.cy += 2 * TRAY_CLOCK_WND_SPACING_Y;
309
310 *pSize = szMax;
311
312 return iLinesVisible;
313}
314
316{
317 SIZE szPrevCurrent;
318 UINT BufSize, i;
319 INT iRet;
320 RECT rcClient;
321
323
324 szPrevCurrent = CurrentSize;
325
326 for (i = 0; i < CLOCKWND_FORMAT_COUNT; i++)
327 {
328 szLines[i][0] = L'\0';
330
332 {
335 &LocalTime,
336 ClockWndFormats[i].lpFormat,
337 szLines[i],
338 BufSize);
339 }
340 else
341 {
344 &LocalTime,
346 szLines[i],
347 BufSize);
348 }
349
350 if (iRet != 0 && i == 0)
351 {
352 /* Set the window text to the time only */
354 }
355 }
356
358
359 if (LinesMeasured &&
360 GetClientRect(&rcClient))
361 {
362 SIZE szWnd;
363
364 szWnd.cx = rcClient.right;
365 szWnd.cy = rcClient.bottom;
366
368 CurrentSize = szWnd;
369 }
370
371 if (IsWindowVisible())
372 {
374
375 if (szPrevCurrent.cx != CurrentSize.cx ||
376 szPrevCurrent.cy != CurrentSize.cy)
377 {
378 /* Ask the parent to resize */
379 NMHDR nmh = {GetParent(), 0, NTNWM_REALIGN};
381 }
382 }
383
384 int iDateLength = GetDateFormat(LOCALE_USER_DEFAULT,
386 &LocalTime,
387 NULL,
388 NULL,
389 0);
390 if (iDateLength <= 0)
391 {
392 return;
393 }
394
395 WCHAR* szDate = new WCHAR[iDateLength];
398 &LocalTime,
399 NULL,
400 szDate,
401 iDateLength) > 0)
402 {
404 reinterpret_cast<UINT_PTR>(m_hWnd),
405 szDate);
406 }
407 delete[] szDate;
408}
409
411{
413 UpdateWnd();
414}
415
417{
418 UINT uiDueTime;
419
421 uiDueTime = 1000 - (UINT) LocalTime.wMilliseconds;
423 uiDueTime += (59 - (UINT) LocalTime.wSecond) * 1000;
424
425 return uiDueTime;
426}
427
429{
430 UINT uiDueTime;
431 BOOL Ret;
432
433 /* Disable all timers */
434 if (IsTimerEnabled)
435 {
438 }
439 else if (IsInitTimerEnabled)
440 {
442 }
443
444 uiDueTime = CalculateDueTime();
445
446 /* Set the new timer */
447 Ret = SetTimer(ID_TRAYCLOCK_TIMER_INIT, uiDueTime, NULL) != 0;
448 IsInitTimerEnabled = Ret;
449
450 return Ret;
451}
452
454{
455 UINT uiDueTime;
456 BOOL Ret;
457 UINT uiWait1, uiWait2;
458
459 /* Kill the initialization timer */
462
463 uiDueTime = CalculateDueTime();
464
466 {
467 uiWait1 = 1000 - 200;
468 uiWait2 = 1000;
469 }
470 else
471 {
472 uiWait1 = 60 * 1000 - 200;
473 uiWait2 = 60 * 1000;
474 }
475
476 if (uiDueTime > uiWait1)
477 {
478 /* The update of the clock will be up to 200 ms late, but that's
479 acceptable. We're going to setup a timer that fires depending
480 uiWait2. */
481 Ret = SetTimer(ID_TRAYCLOCK_TIMER, uiWait2, NULL) != 0;
482 IsTimerEnabled = Ret;
483 }
484 else
485 {
486 /* Recalibrate the timer and recalculate again when the current
487 minute/second ends. */
488 ResetTime();
489 }
490
491 /* Update the time */
492 Update();
493}
494
496{
497 /* Disable all timers */
498 if (IsTimerEnabled)
499 {
501 }
502 else if (IsInitTimerEnabled)
503 {
505 }
506
507 return TRUE;
508}
509
511{
512 RECT rcClient;
513 HFONT hPrevFont;
514 INT iPrevBkMode;
515 UINT i, line;
516 PAINTSTRUCT ps;
517 HDC hDC = (HDC) wParam;
518
519 if (wParam == 0)
520 hDC = BeginPaint(&ps);
521
522 if (hDC == NULL)
523 return FALSE;
524
525 if (LinesMeasured &&
526 GetClientRect(&rcClient))
527 {
528 iPrevBkMode = SetBkMode(hDC, TRANSPARENT);
529
530 if (!IsAppThemed())
532
534
535 hPrevFont = (HFONT) SelectObject(hDC, hFont);
536
537 rcClient.top = (rcClient.bottom - CurrentSize.cy) / 2;
538 rcClient.bottom = rcClient.top + CurrentSize.cy;
539
540 if (VisibleLines == 2)
541 {
542 /* Display either time and weekday (by default), or time and date (opt-in) */
543 PaintLine(hDC, &rcClient, 0, CLOCKWND_FORMAT_TIME);
544 PaintLine(hDC, &rcClient, 1,
546 }
547 else
548 {
549 for (i = 0, line = 0;
551 i++)
552 {
553 PaintLine(hDC, &rcClient, i, i);
554 line++;
555 }
556 }
557
558 SelectObject(hDC, hPrevFont);
559
560 SetBkMode(hDC, iPrevBkMode);
561 }
562
563 if (wParam == 0)
564 EndPaint(&ps);
565
566 return TRUE;
567}
568
570{
571 if (LineSizes[LineNumber].cx == 0)
572 return;
573
574 INT HShift = ((IsHorizontal && (VisibleLines <= 1 ||
576
577 TextOut(hDC,
578 ((rcClient->right - LineSizes[szLinesIndex].cx) / 2) + HShift,
579 rcClient->top + TRAY_CLOCK_WND_SPACING_Y,
580 szLines[szLinesIndex],
581 wcslen(szLines[szLinesIndex]));
582
583 rcClient->top += LineSizes[LineNumber].cy + LineSpacing;
584}
585
587{
588 hFont = hNewFont;
590 if (bRedraw)
591 {
593 }
594}
595
597{
598 RECT rect;
599
602
603 return TRUE;
604}
605
607{
608 HDC hdc = (HDC) wParam;
609
610 if (!IsAppThemed())
611 {
612 bHandled = FALSE;
613 return 0;
614 }
615
616 return DrawBackground(hdc);
617}
618
620{
621 switch (wParam)
622 {
624 Update();
625 break;
626
629 break;
630 }
631 return TRUE;
632}
633
635{
637
638 return (LRESULT) GetMinimumSize((BOOL) wParam, (PSIZE) lParam) != 0;
639}
640
642{
643 return GetParent().SendMessage(uMsg, wParam, lParam);
644}
645
647{
649 return TRUE;
650}
651
653{
655
656 TOOLINFOW ti = { 0 };
657 ti.cbSize = TTTOOLINFOW_V1_SIZE;
658 ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
659 ti.hwnd = m_hWnd;
660 ti.uId = reinterpret_cast<UINT_PTR>(m_hWnd);
661 ti.lpszText = NULL;
662 ti.lParam = NULL;
663
664 m_tooltip.AddTool(&ti);
665
667 {
668 ResetTime();
669 }
670
671 /* Update the time */
672 Update();
673
674 return TRUE;
675}
676
678{
679 SIZE szClient;
680
681 szClient.cx = LOWORD(lParam);
682 szClient.cy = HIWORD(lParam);
683
685 CurrentSize = szClient;
686
687 UpdateWnd();
688 return TRUE;
689}
690
692{
693 BOOL bRealign = FALSE;
694
695 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
696 if (newSettings->bShowSeconds != g_TaskbarSettings.bShowSeconds)
697 {
700 {
701 bRealign = TRUE;
702
703 ResetTime();
704 }
705 }
706
707 if (newSettings->sr.HideClock != g_TaskbarSettings.sr.HideClock)
708 {
711 bRealign = TRUE;
712
714 {
715 /* Disable all timers */
716 if (IsTimerEnabled)
717 {
720 }
721 else if (IsInitTimerEnabled)
722 {
725 }
726 }
727 else
728 {
729 ResetTime();
730 }
731 }
732
733 if (newSettings->bPreferDate != g_TaskbarSettings.bPreferDate)
734 {
736 bRealign = TRUE;
737 }
738
739 if (bRealign)
740 {
741 /* Ask the parent to resize */
742 NMHDR nmh = {GetParent(), 0, NTNWM_REALIGN};
744 Update();
745 }
746 return 0;
747}
748
750{
751 if (IsWindowVisible())
752 {
753 //FIXME: use SHRunControlPanel
754 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
755 }
756 return TRUE;
757}
758
760{
762
763 /* Create the window. The tray window is going to move it to the correct
764 position and resize it as needed. */
765 DWORD dwStyle = WS_CHILD | WS_CLIPSIBLINGS;
767 dwStyle |= WS_VISIBLE;
768
769 Create(hWndParent, 0, NULL, dwStyle);
770 if (!m_hWnd)
771 return E_FAIL;
772
773 SetWindowTheme(m_hWnd, L"TrayNotify", NULL);
774
775 return S_OK;
776
777};
778
780{
781 return ShellObjectCreatorInit<CTrayClockWnd>(hwndParent, riid, ppv);
782}
static HDC hDC
Definition: 3dtext.c:33
#define BufSize
Definition: FsRtlTunnel.c:28
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 LineNumber
Definition: acpixf.h:1220
@ Create
Definition: registry.c:563
#define TNWM_GETMINIMUMSIZE
Definition: precomp.h:367
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
#define TWM_SETTINGSCHANGED
Definition: precomp.h:133
#define NTNWM_REALIGN
Definition: precomp.h:370
HDC GetDC()
Definition: atlwin.h:547
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1116
CWindow GetParent() const
Definition: atlwin.h:700
BOOL IsWindowVisible() const
Definition: atlwin.h:958
HWND m_hWnd
Definition: atlwin.h:273
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:749
SIZE CurrentSize
Definition: trayclock.cpp:71
WORD VisibleLines
Definition: trayclock.cpp:72
CTooltips m_tooltip
Definition: trayclock.cpp:57
LRESULT OnThemeChanged()
Definition: trayclock.cpp:170
BOOL MeasureLines()
Definition: trayclock.cpp:202
LRESULT DrawBackground(HDC hdc)
Definition: trayclock.cpp:596
DWORD LinesMeasured
Definition: trayclock.cpp:66
HRESULT Initialize(IN HWND hWndParent)
Definition: trayclock.cpp:759
DWORD LineSpacing
Definition: trayclock.cpp:70
VOID CalibrateTimer()
Definition: trayclock.cpp:453
COLORREF textColor
Definition: trayclock.cpp:54
VOID UpdateWnd()
Definition: trayclock.cpp:315
DWORD IsTimerEnabled
Definition: trayclock.cpp:64
UINT CalculateDueTime()
Definition: trayclock.cpp:416
LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:641
DWORD IsHorizontal
Definition: trayclock.cpp:67
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:606
WCHAR szLines[CLOCKWND_FORMAT_COUNT][48]
Definition: trayclock.cpp:74
SYSTEMTIME LocalTime
Definition: trayclock.cpp:56
virtual ~CTrayClockWnd()
Definition: trayclock.cpp:168
LRESULT OnTaskbarSettingsChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:691
VOID SetFont(IN HFONT hNewFont, IN BOOL bRedraw)
Definition: trayclock.cpp:586
LRESULT OnSetFont(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:646
BOOL ResetTime()
Definition: trayclock.cpp:428
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:652
SIZE LineSizes[CLOCKWND_FORMAT_COUNT]
Definition: trayclock.cpp:73
LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:510
HRESULT WINAPI GetWindow(HWND *phwnd)
Definition: trayclock.cpp:108
WORD GetMinimumSize(IN BOOL Horizontal, IN OUT PSIZE pSize)
Definition: trayclock.cpp:258
LRESULT OnGetMinimumSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:634
HRESULT WINAPI ContextSensitiveHelp(BOOL fEnterMode)
Definition: trayclock.cpp:116
VOID PaintLine(IN HDC hDC, IN OUT RECT *rcClient, IN UINT LineNumber, IN UINT szLinesIndex)
Definition: trayclock.cpp:569
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:619
DWORD IsInitTimerEnabled
Definition: trayclock.cpp:65
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:677
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:495
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:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:679
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:651
#define END_COM_MAP()
Definition: atlcom.h:592
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1926
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1898
#define END_MSG_MAP()
Definition: atlwin.h:1917
#define DECLARE_WND_CLASS_EX(WndClassName, style, bkgnd)
Definition: atlwin.h:2004
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:2486
#define _countof(array)
Definition: sndvol32.h:70
& rect
Definition: startmenu.cpp:1413
TW_STRUCKRECTS2 sr
Definition: precomp.h:225
BOOL bShowSeconds
Definition: precomp.h:219
BOOL UseCompactTrayIcons()
Definition: precomp.h:229
BOOL bPreferDate
Definition: precomp.h:220
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:207
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:779
const UINT ClockWndFormatsCount
Definition: trayclock.cpp:38
#define CLOCKWND_FORMAT_COUNT
Definition: trayclock.cpp:40
#define TRAY_CLOCK_WND_SPACING_Y
Definition: trayclock.cpp:153
#define TRAY_CLOCK_WND_SPACING_X
Definition: trayclock.cpp:152
static const WCHAR szTrayClockWndClass[]
Definition: trayclock.cpp:45
#define CLOCKWND_FORMAT_DAY
Definition: trayclock.cpp:42
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:149
#define CLOCKWND_FORMAT_DATE
Definition: trayclock.cpp:43
#define CLOCKWND_FORMAT_TIME
Definition: trayclock.cpp:41
const struct @97 ClockWndFormats[]
#define ID_TRAYCLOCK_TIMER_INIT
Definition: trayclock.cpp:150
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:1712
_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:1620
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1625
DWORD WINAPI GetSysColor(_In_ int)
#define SW_HIDE
Definition: winuser.h:768
#define COLOR_BTNTEXT
Definition: winuser.h:933
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WM_CREATE
Definition: winuser.h:1608
#define WM_SIZE
Definition: winuser.h:1611
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1778
#define CS_DBLCLKS
Definition: winuser.h:651
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:1650
#define WM_TIMER
Definition: winuser.h:1742
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define SW_SHOW
Definition: winuser.h:775
#define WM_DESTROY
Definition: winuser.h:1609
#define SetWindowText
Definition: winuser.h:5866
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:769
#define COLOR_3DFACE
Definition: winuser.h:929
static void Initialize()
Definition: xlate.c:212
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185