diff --git a/source/Win95Uptime.cpp b/source/Win95Uptime.cpp index a369f1f..7698e90 100644 --- a/source/Win95Uptime.cpp +++ b/source/Win95Uptime.cpp @@ -155,7 +155,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) hInst = hInstance; // Store instance handle in our global variable hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU, - CW_USEDEFAULT, 0, 480, 220, NULL, NULL, hInstance, NULL); + CW_USEDEFAULT, 0, 480, 240, NULL, NULL, hInstance, NULL); if (!hWnd) { @@ -195,7 +195,29 @@ void GetCrashTime(DWORD ticks, char *buffer, int num){ current_time-=(ticks/1000); current_time+=4294967; // 2**32 milliseconds from boot struct tm* now = localtime(¤t_time); - strftime(buffer, num,"%B %d at %I:%M %p", now); + char timebuffer[300]; + strftime(timebuffer, num,"%B %d at %I:%M %p", now); + TIME_ZONE_INFORMATION tzi; + DWORD timezone_status = GetTimeZoneInformation(&tzi); + if(timezone_status==TIME_ZONE_ID_STANDARD || timezone_status==TIME_ZONE_ID_DAYLIGHT){ + // WE DON'T KNOW WHAT UNICODE IS, IT'S 199FUCKING5. + // So crop the WCHAR down to char. If your timezone has non-ASCII characters in it, tough. + char namebuffer[32]; + const WCHAR* tzname = (timezone_status==TIME_ZONE_ID_DAYLIGHT ? tzi.DaylightName : tzi.StandardName); + int i; + memset(namebuffer,0,sizeof(char)*32); + for(i=0;i<32;i++){ + namebuffer[i]=(char)tzname[i]; + if(namebuffer[i]==0)break; + } + + sprintf(buffer,"%s\n(%s)",timebuffer, namebuffer); + + }else{ + sprintf(buffer,"%s",timebuffer); + } + + } void DrawStopwatch(HDC hdc, int x, int y, unsigned int frame){ diff --git a/source/Win95Uptime.rc b/source/Win95Uptime.rc index aa72c63..f35b8e9 100644 --- a/source/Win95Uptime.rc +++ b/source/Win95Uptime.rc @@ -79,7 +79,7 @@ FONT 8, "System" BEGIN LTEXT "Copyright (C) 2021 Foone Turing",IDC_STATIC,49,20,119,8 ICON IDI_CLOCK,IDC_MYICON,14,9,20,20 - LTEXT "Win95Uptime Version 1.4b",IDC_STATIC,49,10,119,8, + LTEXT "Win95Uptime Version 1.5",IDC_STATIC,49,10,119,8, SS_NOPREFIX DEFPUSHBUTTON "OK",IDOK,195,50,30,11,WS_GROUP LTEXT "Made in Jest by @foone",IDC_STATIC,49,30,119,8 diff --git a/source/Win95Uptime.zip b/source/Win95Uptime.zip new file mode 100644 index 0000000..3a379ec Binary files /dev/null and b/source/Win95Uptime.zip differ