From eb5f406f20c002e66189a83d4db5e20f94b935cc Mon Sep 17 00:00:00 2001 From: Richard Campbell Date: Wed, 14 Jan 2004 20:21:16 +0000 Subject: [PATCH] use GetTimeFormat for explorer, since it displays time properly for the most part. svn path=/trunk/; revision=7624 --- reactos/subsys/system/explorer/taskbar/traynotify.cpp | 10 ++++++---- reactos/subsys/system/explorer/taskbar/traynotify.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/reactos/subsys/system/explorer/taskbar/traynotify.cpp b/reactos/subsys/system/explorer/taskbar/traynotify.cpp index 105477849d3..13a6604ddbd 100644 --- a/reactos/subsys/system/explorer/taskbar/traynotify.cpp +++ b/reactos/subsys/system/explorer/taskbar/traynotify.cpp @@ -329,11 +329,11 @@ HWND ClockWindow::Create(HWND hwndParent) RECT rect = {0, 0, 0, 0}; DrawText(canvas, TEXT("00:00"), -1, &rect, DT_SINGLELINE|DT_NOPREFIX|DT_CALCRECT); - int clockwindowWidth = rect.right-rect.left + 4; + int clockwindowWidth = rect.right-rect.left + 32; return Window::Create(WINDOW_CREATOR(ClockWindow), 0, BtnWindowClass(CLASSNAME_CLOCKWINDOW,CS_DBLCLKS), NULL, WS_CHILD|WS_VISIBLE, - clnt.right-(clockwindowWidth+1), 1, clockwindowWidth, clnt.bottom-2, hwndParent); + clnt.right-(clockwindowWidth), 1, clockwindowWidth, clnt.bottom-2, hwndParent); } LRESULT ClockWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) @@ -383,11 +383,13 @@ bool ClockWindow::FormatTime() { SYSTEMTIME systime; TCHAR buffer[16]; - + TCHAR TimeFormat[] = TEXT("hh':'mm tt"); GetLocalTime(&systime); + GetTimeFormat(LOCALE_USER_DEFAULT,0,NULL,TimeFormat,buffer,sizeof(buffer)); + //_stprintf(buffer, TEXT("%02d:%02d:%02d"), systime.wHour, systime.wMinute, systime.wSecond); - _stprintf(buffer, TEXT("%02d:%02d"), systime.wHour, systime.wMinute); + //_stprintf(buffer, TEXT("%02d:%02d"), systime.wHour, systime.wMinute); if (_tcscmp(buffer, _time)) { _tcscpy(_time, buffer); diff --git a/reactos/subsys/system/explorer/taskbar/traynotify.h b/reactos/subsys/system/explorer/taskbar/traynotify.h index b3914064668..73fb129d881 100644 --- a/reactos/subsys/system/explorer/taskbar/traynotify.h +++ b/reactos/subsys/system/explorer/taskbar/traynotify.h @@ -31,7 +31,7 @@ #define CLASSNAME_CLOCKWINDOW TEXT("TrayClockWClass") -#define NOTIFYAREA_WIDTH_DEF 75 +#define NOTIFYAREA_WIDTH_DEF 100 #define NOTIFYICON_DIST 20 #define NOTIFYAREA_SPACE 10