TaskbarCalculator#
TaskbarCalculator is a C++/Win32 application for Windows 11 that sits in the notification area (system tray) and shows an always-on-top calculator window driven by keyboard input.
The project started as a migration of a previous DeskBand (an in-process COM extension hosted by the taskbar), which Windows 11 no longer loads for third-party shell extensions. The current version is a standalone executable that adds a tray icon: left-click shows/hides the window, right-click opens a menu with Show/Hide, Start at login, About, and Exit.
Code layout#
App.cpp— entry point (wWinMain), single-instance handling, tray icon, and hidden owner window.CalculatorWindow.cpp/.h— calculator window, keyboard input handling, number formatting based on regional settings, positioning and persistence.Calculator.cpp/.h— calculation engine, independent from the UI, based on a state machine (init,first_oper,operation,second_oper,result,error). Supports the four basic operations, square root, percentage, sign change, and reciprocal (1/x).Settings.cpp/.h,StartupManager.cpp/.h,VisualStyle.cpp/.h,TrayIcon.cpp/.h,Utils.cpp/.h— support modules (registry-based window position/visibility, start at login, classic/themed visuals, tray icon, misc utilities).
More detailed architecture and conventions are documented in CLAUDE.md.
Build#
Requires Visual Studio 2022 (v143 toolset), Windows SDK 10.0.26100.0, and the C++/WinRT components for the start-at-login feature.
msbuild TaskbarCalculator.vcxproj /p:Configuration=Debug /p:Platform=x64
msbuild TaskbarCalculator.vcxproj /p:Configuration=Release /p:Platform=x64
Build the .vcxproj directly, not the .sln (which references a setup project not
included in this repository). The executable is produced at
x64\<Config>\TaskbarCalculator.exe.
Test#
The calculation engine (Calculator.cpp/.h) is decoupled from the precompiled header and
is compiled and run separately with a small header-only harness:
tests\build-and-run.cmd
from an "x64 Native Tools Command Prompt".
Packaging#
Two distribution paths are supported:
- Classic installer:
Packaging\TaskbarCalculatorSetup.iss, compiled with Inno Setup (ISCC.exe), or via thePackaging\build-setup.cmdscript, which runs a Release x64 build and compiles the installer in one step. - MSIX: PowerShell scripts in
Packaging\(MakeAssets.ps1,MakeCert.ps1,BuildMsix.ps1), kept for a possible future Microsoft Store submission.
In both cases, start-at-login uses the MSIX StartupTask API when the app is packaged,
falling back to the HKCU\...\Run registry value when installed via the classic path.