# feilingshu/gwct architecture

> Architecture diagram of the GitHub repository feilingshu/gwct, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/feilingshu/gwct
- Repository: https://github.com/feilingshu/gwct

## Overview

GWCT is a Windows desktop utility for configuring game-window size and position, with optional process-affinity and launcher handling. The user adds target executables and settings in the WPF interface, then pushes configuration; the core monitors processes, captures matching game windows, and applies window behavior. The README also describes persistent settings, local exception files, pause controls, styling, logs, statistics, and update checks. Some subsystem links are documented rather than visible in the excerpts, so those are marked unverified; sampled source confirms process-to-window delegation and log buffering.

Main entry points: [`GWCT/MainWindow.xaml.cs`](https://github.com/feilingshu/gwct/blob/main/GWCT/MainWindow.xaml.cs) (Settings UI), [`gwctcore/gwctcore/Tool/ProcMgr.cs`](https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Tool/ProcMgr.cs) (Process discovery), [`gwctcore/gwctcore/Tool/WinCtrl.cs`](https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Tool/WinCtrl.cs) (Window control), [`gwctcore/gwctcore/CoreCtrl/API.cs`](https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/CoreCtrl/API.cs) (Windows APIs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop interface"]
  node_ui["Settings UI<br/>[MainWindow.xaml.cs]"]
  node_bootstrap["App bootstrap<br/>[App.xaml.cs]"]
end

subgraph group_configuration["Configuration"]
  node_settings["Target settings<br/>[Settings.cs]"]
  node_config["Config persistence<br/>[Bin.cs]"]
  node_exceptions["Local exceptions"]
  node_updater["Update check<br/>[Update.cs]"]
end

subgraph group_runtime["Runtime control"]
  node_proc["Process discovery<br/>[ProcMgr.cs]"]
  node_windows["Window control<br/>[WinCtrl.cs]"]
  node_dwm["Window styling<br/>[DWM.cs]"]
  node_affinity["CPU affinity<br/>[Core.cs]"]
  node_cpu["CPU detection<br/>[CPUID.cs]"]
  node_qos["Efficiency mode<br/>[EcoQoS.cs]"]
  node_native["Windows APIs<br/>[API.cs]"]
end

subgraph group_telemetry["Telemetry"]
  node_logs["Log stream<br/>[Logs.cs]"]
  node_logbuffer["Log buffer<br/>[CircularBuffer.cs]"]
  node_tasks["Task statistics<br/>[TaskCount.cs]"]
end

node_user(("User"))

node_user -->|"configures"| node_ui
node_ui -->|"pushes settings"| node_config
node_ui -.->|"edits targets"| node_settings
node_ui -.->|"supplies configuration"| node_proc
node_ui -->|"adds log entries"| node_logs
node_ui -.->|"checks updates"| node_updater
node_proc -->|"registers windows"| node_windows
node_logs -->|"stores entries"| node_logbuffer
node_proc -.->|"tracks work"| node_tasks
node_windows -.->|"tracks work"| node_tasks
node_windows -.->|"uses system calls"| node_native
node_affinity -.->|"detects cores"| node_cpu
node_affinity -.->|"sets affinity"| node_native
node_qos -.->|"sets process mode"| node_native
node_bootstrap -.->|"initializes mode"| node_qos
node_ui -.->|"offers local settings"| node_exceptions
node_ui -.->|"configures appearance"| node_dwm

click node_ui "https://github.com/feilingshu/gwct/blob/main/GWCT/MainWindow.xaml.cs"
click node_bootstrap "https://github.com/feilingshu/gwct/blob/main/GWCT/App.xaml.cs"
click node_settings "https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Datas/Settings.cs"
click node_config "https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Cfg/Bin.cs"
click node_exceptions "https://github.com/feilingshu/gwct/tree/main/gwctcore/gwctcore/Cfg"
click node_updater "https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Cfg/Update.cs"
click node_proc "https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Tool/ProcMgr.cs"
click node_windows "https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Tool/WinCtrl.cs"
click node_dwm "https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Tool/DWM.cs"
click node_affinity "https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/CoreCtrl/Core.cs"
click node_cpu "https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/CoreCtrl/CPUID.cs"
click node_qos "https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/CoreCtrl/EcoQoS.cs"
click node_native "https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/CoreCtrl/API.cs"
click node_logs "https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Datas/Logs.cs"
click node_logbuffer "https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Datas/CircularBuffer.cs"
click node_tasks "https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Datas/TaskCount.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ui,node_bootstrap,node_user toneBlue
class node_settings,node_config,node_exceptions,node_updater toneAmber
class node_proc,node_windows,node_dwm,node_affinity,node_cpu,node_qos,node_native toneMint
class node_logs,node_logbuffer,node_tasks toneRose
```

## Components

### Desktop interface

- [Settings UI](https://github.com/feilingshu/gwct/blob/main/GWCT/MainWindow.xaml.cs): `GWCT/MainWindow.xaml.cs`
- [App bootstrap](https://github.com/feilingshu/gwct/blob/main/GWCT/App.xaml.cs): `GWCT/App.xaml.cs`

### Configuration

- [Target settings](https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Datas/Settings.cs): `gwctcore/gwctcore/Datas/Settings.cs`
- [Config persistence](https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Cfg/Bin.cs): `gwctcore/gwctcore/Cfg/Bin.cs`
- [Local exceptions](https://github.com/feilingshu/gwct/tree/main/gwctcore/gwctcore/Cfg): `gwctcore/gwctcore/Cfg`
- [Update check](https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Cfg/Update.cs): `gwctcore/gwctcore/Cfg/Update.cs`

### Runtime control

- [Process discovery](https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Tool/ProcMgr.cs): `gwctcore/gwctcore/Tool/ProcMgr.cs`
- [Window control](https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Tool/WinCtrl.cs): `gwctcore/gwctcore/Tool/WinCtrl.cs`
- [Window styling](https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Tool/DWM.cs): `gwctcore/gwctcore/Tool/DWM.cs`
- [CPU affinity](https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/CoreCtrl/Core.cs): `gwctcore/gwctcore/CoreCtrl/Core.cs`
- [CPU detection](https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/CoreCtrl/CPUID.cs): `gwctcore/gwctcore/CoreCtrl/CPUID.cs`
- [Efficiency mode](https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/CoreCtrl/EcoQoS.cs): `gwctcore/gwctcore/CoreCtrl/EcoQoS.cs`
- [Windows APIs](https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/CoreCtrl/API.cs): `gwctcore/gwctcore/CoreCtrl/API.cs`

### Telemetry

- [Log stream](https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Datas/Logs.cs): `gwctcore/gwctcore/Datas/Logs.cs`
- [Log buffer](https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Datas/CircularBuffer.cs): `gwctcore/gwctcore/Datas/CircularBuffer.cs`
- [Task statistics](https://github.com/feilingshu/gwct/blob/main/gwctcore/gwctcore/Datas/TaskCount.cs): `gwctcore/gwctcore/Datas/TaskCount.cs`

### Other components

- **User**

## Connections

- User → Settings UI: configures (evidence: `README.md`)
- Settings UI → Config persistence: pushes settings (evidence: `README.md`)
- Settings UI → Target settings: edits targets (evidence: `GWCT/MainWindow.xaml.cs`)
- Settings UI → Process discovery: supplies configuration (evidence: `GWCT/MainWindow.xaml.cs`)
- Settings UI → Log stream: adds log entries (evidence: `GWCT/MainWindow.xaml.cs`)
- Settings UI → Update check: checks updates (evidence: `GWCT/MainWindow.xaml.cs`)
- Process discovery → Window control: registers windows (evidence: `gwctcore/gwctcore/Tool/ProcMgr.cs`)
- Log stream → Log buffer: stores entries (evidence: `gwctcore/gwctcore/Datas/Logs.cs`)
- Process discovery → Task statistics: tracks work (evidence: `gwctcore/gwctcore/Tool/ProcMgr.cs`)
- Window control → Task statistics: tracks work (evidence: `gwctcore/gwctcore/Tool/WinCtrl.cs`)
- Window control → Windows APIs: uses system calls
- CPU affinity → CPU detection: detects cores
- CPU affinity → Windows APIs: sets affinity
- Efficiency mode → Windows APIs: sets process mode
- App bootstrap → Efficiency mode: initializes mode (evidence: `GWCT/App.xaml.cs`)
- Settings UI → Local exceptions: offers local settings (evidence: `GWCT/MainWindow.xaml.cs`)
- Settings UI → Window styling: configures appearance
