ReactOS 0.4.16-dev-983-g23ad936
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 // *** IOleWindow methods ***
108
110 GetWindow(HWND* phwnd) override
111 {
112 if (!phwnd)
113 return E_INVALIDARG;
114 *phwnd = m_hWnd;
115 return S_OK;
116 }
117
119 ContextSensitiveHelp(BOOL fEnterMode) override
120 {
121 return E_NOTIMPL;
122 }
123
125
130
132
140 MESSAGE_HANDLER(WM_THEMECHANGED, OnThemeChanged)
148
150};
151
152#define ID_TRAYCLOCK_TIMER 0
153#define ID_TRAYCLOCK_TIMER_INIT 1
154
155#define TRAY_CLOCK_WND_SPACING_X 5
156#define TRAY_CLOCK_WND_SPACING_Y 0
157
159 hFont(NULL),
160 textColor(0),
161 dwFlags(0),
162 LineSpacing(0),
163 VisibleLines(0)
164{
165 ZeroMemory(&rcText, sizeof(rcText));
166 ZeroMemory(&LocalTime, sizeof(LocalTime));
169 ZeroMemory(szLines, sizeof(szLines));
170}
172
174{
175 LOGFONTW clockFont;
176 HTHEME clockTheme;
177 HFONT hFont;
178
179 clockTheme = OpenThemeData(m_hWnd, L"Clock");
180
181 if (clockTheme)
182 {
183 GetThemeFont(clockTheme, NULL, CLP_TIME, 0, TMT_FONT, &clockFont);
184
185 hFont = CreateFontIndirectW(&clockFont);
186
188
189 if (this->hFont != NULL)
190 DeleteObject(this->hFont);
191
193
194 CloseThemeData(clockTheme);
195 }
196
197 return TRUE;
198}
199
201{
202 return OnThemeChanged();
203}
204
206{
207 HDC hDC;
208 HFONT hPrevFont;
209 UINT c, i;
210 BOOL bRet = TRUE;
211
212 hDC = GetDC();
213 if (hDC != NULL)
214 {
215 if (hFont)
216 hPrevFont = (HFONT) SelectObject(hDC, hFont);
217
218 for (i = 0; i < CLOCKWND_FORMAT_COUNT && bRet; i++)
219 {
220 if (szLines[i][0] != L'\0' &&
222 &LineSizes[i]))
223 {
224 bRet = FALSE;
225 break;
226 }
227 }
228
229 if (hFont)
230 SelectObject(hDC, hPrevFont);
231
232 ReleaseDC(hDC);
233
234 if (bRet)
235 {
236 LineSpacing = 0;
237
238 /* calculate the line spacing */
239 for (i = 0, c = 0; i < CLOCKWND_FORMAT_COUNT; i++)
240 {
241 if (LineSizes[i].cx > 0)
242 {
244 c++;
245 }
246 }
247
248 if (c > 0)
249 {
250 /* We want a spacing of 1/2 line */
251 LineSpacing = (LineSpacing / c) / 2;
252 }
253
254 return TRUE;
255 }
256 }
257
258 return FALSE;
259}
260
262{
263 WORD iLinesVisible = 0;
264 UINT i;
265 SIZE szMax = { 0, 0 };
266
267 if (!LinesMeasured)
269
270 if (!LinesMeasured)
271 return 0;
272
273 /* Prevents the date from being cut off when the day of the week is shorter than the date. */
276
277 for (i = 0; i < CLOCKWND_FORMAT_COUNT; i++)
278 {
279 if (LineSizes[i].cx != 0)
280 {
281 if (iLinesVisible > 0)
282 {
283 if (Horizontal)
284 {
285 if (szMax.cy + LineSizes[i].cy + (LONG) LineSpacing >
286 pSize->cy - (2 * TRAY_CLOCK_WND_SPACING_Y))
287 {
288 break;
289 }
290 }
291 else
292 {
293 if (LineSizes[i].cx > pSize->cx - (2 * TRAY_CLOCK_WND_SPACING_X))
294 break;
295 }
296
297 /* Add line spacing */
298 szMax.cy += LineSpacing;
299 }
300
301 iLinesVisible++;
302
303 /* Increase maximum rectangle */
304 szMax.cy += LineSizes[i].cy;
305 if (LineSizes[i].cx > szMax.cx)
306 szMax.cx = LineSizes[i].cx;
307 }
308 }
309
310 szMax.cx += 2 * TRAY_CLOCK_WND_SPACING_X;
311 szMax.cy += 2 * TRAY_CLOCK_WND_SPACING_Y;
312
313 *pSize = szMax;
314
315 return iLinesVisible;
316}
317
319{
320 SIZE szPrevCurrent;
321 UINT BufSize, i;
322 INT iRet;
323 RECT rcClient;
324
326
327 szPrevCurrent = CurrentSize;
328
329 for (i = 0; i < CLOCKWND_FORMAT_COUNT; i++)
330 {
331 szLines[i][0] = L'\0';
333
335 {
338 &LocalTime,
339 ClockWndFormats[i].lpFormat,
340 szLines[i],
341 BufSize);
342 }
343 else
344 {
347 &LocalTime,
349 szLines[i],
350 BufSize);
351 }
352
353 if (iRet != 0 && i == 0)
354 {
355 /* Set the window text to the time only */
357 }
358 }
359
361
362 if (LinesMeasured &&
363 GetClientRect(&rcClient))
364 {
365 SIZE szWnd;
366
367 szWnd.cx = rcClient.right;
368 szWnd.cy = rcClient.bottom;
369
371 CurrentSize = szWnd;
372 }
373
374 if (IsWindowVisible())
375 {
377
378 if (szPrevCurrent.cx != CurrentSize.cx ||
379 szPrevCurrent.cy != CurrentSize.cy)
380 {
381 /* Ask the parent to resize */
382 NMHDR nmh = {GetParent(), 0, NTNWM_REALIGN};
384 }
385 }
386
387 int iDateLength = GetDateFormat(LOCALE_USER_DEFAULT,
389 &LocalTime,
390 NULL,
391 NULL,
392 0);
393 if (iDateLength <= 0)
394 {
395 return;
396 }
397
398 WCHAR* szDate = new WCHAR[iDateLength];
401 &LocalTime,
402 NULL,
403 szDate,
404 iDateLength) > 0)
405 {
407 reinterpret_cast<UINT_PTR>(m_hWnd),
408 szDate);
409 }
410 delete[] szDate;
411}
412
414{
416 UpdateWnd();
417}
418
420{
421 UINT uiDueTime;
422
424 uiDueTime = 1000 - (UINT) LocalTime.wMilliseconds;
426 uiDueTime += (59 - (UINT) LocalTime.wSecond) * 1000;
427
428 return uiDueTime;
429}
430
432{
433 UINT uiDueTime;
434 BOOL Ret;
435
436 /* Disable all timers */
437 if (IsTimerEnabled)
438 {
441 }
442 else if (IsInitTimerEnabled)
443 {
445 }
446
447 uiDueTime = CalculateDueTime();
448
449 /* Set the new timer */
450 Ret = SetTimer(ID_TRAYCLOCK_TIMER_INIT, uiDueTime, NULL) != 0;
451 IsInitTimerEnabled = Ret;
452
453 return Ret;
454}
455
457{
458 UINT uiDueTime;
459 BOOL Ret;
460 UINT uiWait1, uiWait2;
461
462 /* Kill the initialization timer */
465
466 uiDueTime = CalculateDueTime();
467
469 {
470 uiWait1 = 1000 - 200;
471 uiWait2 = 1000;
472 }
473 else
474 {
475 uiWait1 = 60 * 1000 - 200;
476 uiWait2 = 60 * 1000;
477 }
478
479 if (uiDueTime > uiWait1)
480 {
481 /* The update of the clock will be up to 200 ms late, but that's
482 acceptable. We're going to setup a timer that fires depending
483 uiWait2. */
484 Ret = SetTimer(ID_TRAYCLOCK_TIMER, uiWait2, NULL) != 0;
485 IsTimerEnabled = Ret;
486 }
487 else
488 {
489 /* Recalibrate the timer and recalculate again when the current
490 minute/second ends. */
491 ResetTime();
492 }
493
494 /* Update the time */
495 Update();
496}
497
499{
500 /* Disable all timers */
501 if (IsTimerEnabled)
502 {
504 }
505 else if (IsInitTimerEnabled)
506 {
508 }
509
510 return TRUE;
511}
512
514{
515 RECT rcClient;
516 HFONT hPrevFont;
517 INT iPrevBkMode;
518 UINT i, line;
519 PAINTSTRUCT ps;
520 HDC hDC = (HDC) wParam;
521
522 if (wParam == 0)
523 hDC = BeginPaint(&ps);
524
525 if (hDC == NULL)
526 return FALSE;
527
528 if (LinesMeasured &&
529 GetClientRect(&rcClient))
530 {
531 iPrevBkMode = SetBkMode(hDC, TRANSPARENT);
532
533 if (!IsAppThemed())
535
537
538 hPrevFont = (HFONT) SelectObject(hDC, hFont);
539
540 rcClient.top = (rcClient.bottom - CurrentSize.cy) / 2;
541 rcClient.bottom = rcClient.top + CurrentSize.cy;
542
543 if (VisibleLines == 2)
544 {
545 /* Display either time and weekday (by default), or time and date (opt-in) */
546 PaintLine(hDC, &rcClient, 0, CLOCKWND_FORMAT_TIME);
547 PaintLine(hDC, &rcClient, 1,
549 }
550 else
551 {
552 for (i = 0, line = 0;
554 i++)
555 {
556 PaintLine(hDC, &rcClient, i, i);
557 line++;
558 }
559 }
560
561 SelectObject(hDC, hPrevFont);
562
563 SetBkMode(hDC, iPrevBkMode);
564 }
565
566 if (wParam == 0)
567 EndPaint(&ps);
568
569 return TRUE;
570}
571
573{
574 if (LineSizes[LineNumber].cx == 0)
575 return;
576
577 INT HShift = ((IsHorizontal && (VisibleLines <= 1 ||
579
580 TextOut(hDC,
581 ((rcClient->right - LineSizes[szLinesIndex].cx) / 2) + HShift,
582 rcClient->top + TRAY_CLOCK_WND_SPACING_Y,
583 szLines[szLinesIndex],
584 wcslen(szLines[szLinesIndex]));
585
586 rcClient->top += LineSizes[LineNumber].cy + LineSpacing;
587}
588
590{
591 hFont = hNewFont;
593 if (bRedraw)
594 {
596 }
597}
598
600{
601 RECT rect;
602
605
606 return TRUE;
607}
608
610{
611 HDC hdc = (HDC) wParam;
612
613 if (!IsAppThemed())
614 {
615 bHandled = FALSE;
616 return 0;
617 }
618
619 return DrawBackground(hdc);
620}
621
623{
624 switch (wParam)
625 {
627 Update();
628 break;
629
632 break;
633 }
634 return TRUE;
635}
636
638{
640
641 return (LRESULT) GetMinimumSize((BOOL) wParam, (PSIZE) lParam) != 0;
642}
643
645{
646 return GetParent().SendMessage(uMsg, wParam, lParam);
647}
648
650{
652 return TRUE;
653}
654
656{
658
659 TOOLINFOW ti = { 0 };
660 ti.cbSize = TTTOOLINFOW_V1_SIZE;
661 ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
662 ti.hwnd = m_hWnd;
663 ti.uId = reinterpret_cast<UINT_PTR>(m_hWnd);
664 ti.lpszText = NULL;
665 ti.lParam = NULL;
666
667 m_tooltip.AddTool(&ti);
668
670 {
671 ResetTime();
672 }
673
674 /* Update the time */
675 Update();
676
677 return TRUE;
678}
679
681{
682 SIZE szClient;
683
684 szClient.cx = LOWORD(lParam);
685 szClient.cy = HIWORD(lParam);
686
688 CurrentSize = szClient;
689
690 UpdateWnd();
691 return TRUE;
692}
693
695{
696 BOOL bRealign = FALSE;
697
698 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
699 if (newSettings->bShowSeconds != g_TaskbarSettings.bShowSeconds)
700 {
703 {
704 bRealign = TRUE;
705
706 ResetTime();
707 }
708 }
709
710 if (newSettings->sr.HideClock != g_TaskbarSettings.sr.HideClock)
711 {
714 bRealign = TRUE;
715
717 {
718 /* Disable all timers */
719 if (IsTimerEnabled)
720 {
723 }
724 else if (IsInitTimerEnabled)
725 {
728 }
729 }
730 else
731 {
732 ResetTime();
733 }
734 }
735
736 if (newSettings->bPreferDate != g_TaskbarSettings.bPreferDate)
737 {
739 bRealign = TRUE;
740 }
741
742 if (bRealign)
743 {
744 /* Ask the parent to resize */
745 NMHDR nmh = {GetParent(), 0, NTNWM_REALIGN};
747 Update();
748 }
749 return 0;
750}
751
753{
754 if (IsWindowVisible())
755 {
756 //FIXME: use SHRunControlPanel
757 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
758 }
759 return TRUE;
760}
761
763{
765
766 /* Create the window. The tray window is going to move it to the correct
767 position and resize it as needed. */
768 DWORD dwStyle = WS_CHILD | WS_CLIPSIBLINGS;
770 dwStyle |= WS_VISIBLE;
771
772 Create(hWndParent, 0, NULL, dwStyle);
773 if (!m_hWnd)
774 return E_FAIL;
775
776 SetWindowTheme(m_hWnd, L"TrayNotify", NULL);
777
778 return S_OK;
779
780};
781
783{
784 return ShellObjectCreatorInit<CTrayClockWnd>(hwndParent, riid, ppv);
785}
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:371
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
#define TWM_SETTINGSCHANGED
Definition: precomp.h:134
#define NTNWM_REALIGN
Definition: precomp.h:375
#define STDMETHODIMP
Definition: basetyps.h:43
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:752
SIZE CurrentSize
Definition: trayclock.cpp:71
WORD VisibleLines
Definition: trayclock.cpp:72
CTooltips m_tooltip
Definition: trayclock.cpp:57
LRESULT OnThemeChanged()
Definition: trayclock.cpp:173
BOOL MeasureLines()
Definition: trayclock.cpp:205
LRESULT DrawBackground(HDC hdc)
Definition: trayclock.cpp:599
DWORD LinesMeasured
Definition: trayclock.cpp:66
HRESULT Initialize(IN HWND hWndParent)
Definition: trayclock.cpp:762
DWORD LineSpacing
Definition: trayclock.cpp:70
VOID CalibrateTimer()
Definition: trayclock.cpp:456
COLORREF textColor
Definition: trayclock.cpp:54
VOID UpdateWnd()
Definition: trayclock.cpp:318
DWORD IsTimerEnabled
Definition: trayclock.cpp:64
UINT CalculateDueTime()
Definition: trayclock.cpp:419
LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:644
DWORD IsHorizontal
Definition: trayclock.cpp:67
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:609
WCHAR szLines[CLOCKWND_FORMAT_COUNT][48]
Definition: trayclock.cpp:74
SYSTEMTIME LocalTime
Definition: trayclock.cpp:56
virtual ~CTrayClockWnd()
Definition: trayclock.cpp:171
LRESULT OnTaskbarSettingsChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:694
STDMETHODIMP GetWindow(HWND *phwnd) override
Definition: trayclock.cpp:110
VOID SetFont(IN HFONT hNewFont, IN BOOL bRedraw)
Definition: trayclock.cpp:589
LRESULT OnSetFont(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:649
BOOL ResetTime()
Definition: trayclock.cpp:431
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:655
SIZE LineSizes[CLOCKWND_FORMAT_COUNT]
Definition: trayclock.cpp:73
LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:513
WORD GetMinimumSize(IN BOOL Horizontal, IN OUT PSIZE pSize)
Definition: trayclock.cpp:261
LRESULT OnGetMinimumSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:637
VOID PaintLine(IN HDC hDC, IN OUT RECT *rcClient, IN UINT LineNumber, IN UINT szLinesIndex)
Definition: trayclock.cpp:572
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:622
DWORD IsInitTimerEnabled
Definition: trayclock.cpp:65
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:680
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayclock.cpp:498
STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode) override
Definition: trayclock.cpp:119
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:850
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:965
BOOL WINAPI IsAppThemed(void)
Definition: system.c:611
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:88
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:709
#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:2507
#define _countof(array)
Definition: sndvol32.h:70
& rect
Definition: startmenu.cpp:1413
TW_STRUCKRECTS2 sr
Definition: precomp.h:226
BOOL bShowSeconds
Definition: precomp.h:220
BOOL UseCompactTrayIcons()
Definition: precomp.h:230
BOOL bPreferDate
Definition: precomp.h:221
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
WORD wMilliseconds
Definition: winbase.h:943
WORD wSecond
Definition: winbase.h:942
DWORD HideClock
Definition: precomp.h:208
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:782
const UINT ClockWndFormatsCount
Definition: trayclock.cpp:38
#define CLOCKWND_FORMAT_COUNT
Definition: trayclock.cpp:40
#define TRAY_CLOCK_WND_SPACING_Y
Definition: trayclock.cpp:156
#define TRAY_CLOCK_WND_SPACING_X
Definition: trayclock.cpp:155
const struct @92 ClockWndFormats[]
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:152
#define CLOCKWND_FORMAT_DATE
Definition: trayclock.cpp:43
#define CLOCKWND_FORMAT_TIME
Definition: trayclock.cpp:41
#define ID_TRAYCLOCK_TIMER_INIT
Definition: trayclock.cpp:153
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:1743
_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
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:1546
#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:1245
#define TIME_NOSECONDS
Definition: winnls.h:280
#define DATE_LONGDATE
Definition: winnls.h:199
#define GetDateFormat
Definition: winnls.h:1240
#define DATE_SHORTDATE
Definition: winnls.h:198
#define WM_PAINT
Definition: winuser.h:1631
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1636
DWORD WINAPI GetSysColor(_In_ int)
#define SW_HIDE
Definition: winuser.h:779
#define COLOR_BTNTEXT
Definition: winuser.h:944
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WM_CREATE
Definition: winuser.h:1619
#define WM_SIZE
Definition: winuser.h:1622
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1789
#define CS_DBLCLKS
Definition: winuser.h:659
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:1661
#define WM_TIMER
Definition: winuser.h:1753
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define SW_SHOW
Definition: winuser.h:786
#define WM_DESTROY
Definition: winuser.h:1620
#define SetWindowText
Definition: winuser.h:5877
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:780
#define COLOR_3DFACE
Definition: winuser.h:940
static void Initialize()
Definition: xlate.c:212
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185