···11# TaskbarCalculator
2233-TaskbarCalculator è un'applicazione C++/Win32 per Windows 11 che risiede nell'area di
44-notifica (system tray) e mostra una finestra calcolatrice sempre in primo piano,
55-utilizzabile da tastiera.
33+TaskbarCalculator is a C++/Win32 application for Windows 11 that sits in the notification
44+area (system tray) and shows an always-on-top calculator window driven by keyboard input.
6577-Il progetto nasce come migrazione di una precedente DeskBand (un'estensione COM in-process
88-ospitata dalla taskbar), non più caricabile su Windows 11 dalla shell per estensioni di
99-terze parti. La versione attuale è un eseguibile standalone che aggiunge un'icona nell'area
1010-di notifica: click sinistro mostra/nasconde la finestra, click destro apre un menu con le
1111-opzioni Show/Hide, Start at login, About ed Exit.
66+The project started as a migration of a previous DeskBand (an in-process COM extension
77+hosted by the taskbar), which Windows 11 no longer loads for third-party shell extensions.
88+The current version is a standalone executable that adds a tray icon: left-click
99+shows/hides the window, right-click opens a menu with Show/Hide, Start at login, About, and
1010+Exit.
12111313-## Struttura del codice
1212+## Code layout
14131515-- `App.cpp` — punto di ingresso (`wWinMain`), gestione singola istanza, icona di tray e
1616- finestra proprietaria nascosta.
1717-- `CalculatorWindow.cpp/.h` — finestra della calcolatrice, gestione input da tastiera,
1818- formattazione dei numeri secondo le impostazioni regionali, posizionamento e persistenza.
1919-- `Calculator.cpp/.h` — motore di calcolo, indipendente dalla UI, basato su una macchina a
2020- stati (`init`, `first_oper`, `operation`, `second_oper`, `result`, `error`). Supporta le
2121- quattro operazioni di base, radice quadrata, percentuale, cambio di segno, reciproco
2222- (1/x).
1414+- `App.cpp` — entry point (`wWinMain`), single-instance handling, tray icon, and hidden
1515+ owner window.
1616+- `CalculatorWindow.cpp/.h` — calculator window, keyboard input handling, number
1717+ formatting based on regional settings, positioning and persistence.
1818+- `Calculator.cpp/.h` — calculation engine, independent from the UI, based on a state
1919+ machine (`init`, `first_oper`, `operation`, `second_oper`, `result`, `error`). Supports
2020+ the four basic operations, square root, percentage, sign change, and reciprocal (1/x).
2321- `Settings.cpp/.h`, `StartupManager.cpp/.h`, `VisualStyle.cpp/.h`, `TrayIcon.cpp/.h`,
2424- `Utils.cpp/.h` — moduli di supporto (registro per posizione/visibilità finestra, avvio
2525- automatico al login, tema classico/moderno, icona di tray, utilità varie).
2222+ `Utils.cpp/.h` — support modules (registry-based window position/visibility, start at
2323+ login, classic/themed visuals, tray icon, misc utilities).
26242727-Dettagli più approfonditi su architettura e convenzioni si trovano in `CLAUDE.md`.
2525+More detailed architecture and conventions are documented in `CLAUDE.md`.
28262927## Build
30283131-Richiede Visual Studio 2022 (toolset v143), Windows SDK 10.0.26100.0 e i componenti
3232-C++/WinRT per la funzionalità di avvio al login.
2929+Requires Visual Studio 2022 (v143 toolset), Windows SDK 10.0.26100.0, and the C++/WinRT
3030+components for the start-at-login feature.
33313432```
3533msbuild TaskbarCalculator.vcxproj /p:Configuration=Debug /p:Platform=x64
3634msbuild TaskbarCalculator.vcxproj /p:Configuration=Release /p:Platform=x64
3735```
38363939-Va compilato il file `.vcxproj` direttamente, non la `.sln` (che referenzia un progetto di
4040-setup non presente in questo repository). L'eseguibile viene prodotto in
3737+Build the `.vcxproj` directly, not the `.sln` (which references a setup project not
3838+included in this repository). The executable is produced at
4139`x64\<Config>\TaskbarCalculator.exe`.
42404341## Test
44424545-Il motore di calcolo (`Calculator.cpp/.h`) è indipendente dal precompiled header e viene
4646-compilato ed eseguito separatamente con un piccolo harness header-only:
4343+The calculation engine (`Calculator.cpp/.h`) is decoupled from the precompiled header and
4444+is compiled and run separately with a small header-only harness:
47454846```
4947tests\build-and-run.cmd
5048```
51495252-da un prompt "x64 Native Tools Command Prompt".
5050+from an "x64 Native Tools Command Prompt".
53515452## Packaging
55535656-Sono previste due modalità di distribuzione:
5454+Two distribution paths are supported:
57555858-- **Installer classico**: `Packaging\TaskbarCalculatorSetup.iss`, compilato con Inno Setup
5959- (`ISCC.exe`), oppure tramite lo script `Packaging\build-setup.cmd` che esegue build
6060- Release x64 e compilazione dell'installer in un solo passaggio.
6161-- **MSIX**: script PowerShell in `Packaging\` (`MakeAssets.ps1`, `MakeCert.ps1`,
6262- `BuildMsix.ps1`), mantenuto in vista di una eventuale pubblicazione sul Microsoft Store.
5656+- **Classic installer**: `Packaging\TaskbarCalculatorSetup.iss`, compiled with Inno Setup
5757+ (`ISCC.exe`), or via the `Packaging\build-setup.cmd` script, which runs a Release x64
5858+ build and compiles the installer in one step.
5959+- **MSIX**: PowerShell scripts in `Packaging\` (`MakeAssets.ps1`, `MakeCert.ps1`,
6060+ `BuildMsix.ps1`), kept for a possible future Microsoft Store submission.
63616464-In entrambi i casi l'avvio automatico al login usa l'API MSIX `StartupTask` quando
6565-l'applicazione è pacchettizzata, con fallback sulla chiave di registro
6666-`HKCU\...\Run` quando è installata in modalità classica.
6262+In both cases, start-at-login uses the MSIX `StartupTask` API when the app is packaged,
6363+falling back to the `HKCU\...\Run` registry value when installed via the classic path.