A simple, small calculator placed discreetly near the Windows Taskbar or anywhere on the screen
0

Configure Feed

Select the types of activity you want to include in your feed.

feat: show About dialog version from VERSIONINFO resource

Read the executable's FILEVERSION at runtime (GetFileVersionInfo /
VerQueryValue) and display it in the About dialog instead of a
hardcoded string, so the version has a single source of truth.

- resource.h: add IDC_VERSION control id for the version label
- TaskbarCalculator.rc: give the About version LTEXT the IDC_VERSION id
- AboutDialog.cpp: fill the label in WM_INITDIALOG from VERSIONINFO;
link version.lib

Also carries the pending version bump 3.0.0.0 -> 3.0.1.1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Marco Maroni (Jul 17, 2026, 12:17 PM +0200) 17c64e04 ae5fe978

+39
+39
AboutDialog.cpp
··· 1 1 #include "stdafx.h" 2 2 #include <commctrl.h> 3 + #include <vector> 4 + 5 + #pragma comment(lib, "version.lib") 6 + 7 + // Reads the executable's FILEVERSION from its VERSIONINFO resource, 8 + // formatted as "major.minor.build" (empty on failure). 9 + static ATL::CString GetAppVersionString() 10 + { 11 + ATL::CString result; 12 + WCHAR path[MAX_PATH]; 13 + if (GetModuleFileNameW(NULL, path, MAX_PATH) == 0) 14 + return result; 15 + 16 + DWORD handle = 0; 17 + DWORD size = GetFileVersionInfoSizeW(path, &handle); 18 + if (size == 0) 19 + return result; 20 + 21 + std::vector<BYTE> buffer(size); 22 + if (!GetFileVersionInfoW(path, handle, size, buffer.data())) 23 + return result; 24 + 25 + VS_FIXEDFILEINFO* ffi = nullptr; 26 + UINT len = 0; 27 + if (VerQueryValueW(buffer.data(), L"\\", (LPVOID*)&ffi, &len) && ffi != nullptr) { 28 + result.Format(_T("%u.%u.%u"), 29 + HIWORD(ffi->dwFileVersionMS), 30 + LOWORD(ffi->dwFileVersionMS), 31 + HIWORD(ffi->dwFileVersionLS)); 32 + } 33 + return result; 34 + } 3 35 4 36 INT_PTR CALLBACK AboutDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) 5 37 { ··· 10 42 int x = (GetSystemMetrics(SM_CXSCREEN) - w) / 2; 11 43 int y = (GetSystemMetrics(SM_CYSCREEN) - h) / 2; 12 44 SetWindowPos(hwndDlg, NULL, x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER); 45 + 46 + ATL::CString version = GetAppVersionString(); 47 + if (!version.IsEmpty()) { 48 + ATL::CString text; 49 + text.Format(_T("Taskbar Calculator - %s"), (LPCTSTR)version); 50 + SetDlgItemText(hwndDlg, IDC_VERSION, text); 51 + } 13 52 return TRUE; 14 53 } 15 54 case WM_NOTIFY:
TaskbarCalculator.rc

This is a binary file and will not be displayed.

resource.h

This is a binary file and will not be displayed.