- Add VCP commands for brightness (10), contrast (12), input source (60) - Fix UTF-16 encoding for monitor data parsing - Add system tray app with monitor controls - Add localization for en, es, fr, de, zh, ja, pt, it, hi - Update to .NET 9.0 - Add LICENSE and README 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3.2 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
ControlMyMonitorManagement is a C# WPF desktop application for controlling monitor settings via DDC/CI (Display Data Channel/Command Interface). It allows controlling VCP (Virtual Control Panel) codes like brightness, contrast, and power state across multiple displays.
Build Commands
# Build entire solution
dotnet build ControlMyMonitorManagement.sln
# Build specific project
dotnet build ControlMyMonitorManagement/ControlMyMonitorManagement.csproj
dotnet build DellMonitorControl/DellMonitorControl.csproj
# Run tests
dotnet test Tester/Tester.csproj
# Run main application
dotnet run --project ControlMyMonitorManagement/ControlMyMonitorManagement.csproj
# Run Dell-specific application
dotnet run --project DellMonitorControl/DellMonitorControl.csproj
Architecture
Solution Structure (7 Projects)
ControlMyMonitorManagement.sln
├── ControlMyMonitorManagement # Main WPF UI application
├── DellMonitorControl # Dell-specific WPF app with system tray
├── Library # Core business logic and monitor control
├── CMMModel # Data models for monitor status/VCP codes
├── CMMService # Service layer (Interface/, Service/)
├── Language # Localization support (CulturesHelper)
└── Tester # NUnit test project
Key Components in Library Project
- Method/CMMMgr.cs - Main manager class, initializes monitor collection
- Method/CMMCommand.cs - Core monitor control commands (PowerOn, Sleep, SetBrightness, SetContrast, SetInputSource, etc.)
- ViewModel/XMonitor.cs - Monitor data model (device name, adapter, serial number)
- ViewModel/XMonitorStatus.cs - VCP feature status (code, value, max)
- WinAPI/Win32Api.cs - Windows API interop for DDC/CI commands
- Config/Config.cs - JSON configuration management
- Helpers/ConsoleHelper.cs - Process wrapper for cmd.exe commands
VCP Codes Reference
Common VCP codes used in this project:
- D6 (Power): 1=on, 4=sleep, 5=off
- 10 (Brightness): 0-100
- 12 (Contrast): 0-100
- 60 (Input Source): 1=VGA, 3=DVI, 15=DisplayPort, 17=HDMI
Localization
Supports 9 languages with auto-detection from system locale:
- English (en), Spanish (es), French (fr), German (de)
- Chinese (zh), Japanese (ja), Portuguese (pt), Italian (it), Hindi (hi)
Resource files: Language/StringResources.{locale}.xaml
Helper: Language/CulturesHelper.cs - call ApplySystemLanguage() on startup
Embedded Resource
Library/Resource/ControlMyMonitor.exe - Third-party tool (by Nir Sofer) embedded for DDC/CI operations
Patterns Used
- MVVM - PropertyBase class implements INotifyPropertyChanged
- Async/Await - Monitor scanning operations are async
- Dependency Injection - Used in DellMonitorControl for configuration
Target Framework
.NET 7.0-windows with WPF (UseWPF=true)
Versioning
Dynamic version format: Major.Minor.DaysSinceProjectStart.HourMinutes
- Main app project start: 2017-09-17
- DellMonitorControl start: 2023-07-02