# sribalan98/ghostframe-win architecture

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

- Interactive diagram: https://gitdiagram.com/sribalan98/ghostframe-win
- Repository: https://github.com/sribalan98/ghostframe-win

## Overview

GhostFrame is a Windows screen-capture cloaker. In the primary workflow, a user manages visible application windows in the GUI; window discovery supplies window/process details, and affinity control applies or restores capture exclusion through a helper and injected payload. Focus Mode cloaks other eligible windows while leaving the selected process visible. Persistent auto-hide rules and a separate OBS dock are documented capabilities. Source excerpts establish the main GUI, discovery, affinity, and helper relationships; the README supplies the DWM behavior, while some unsampled implementation details are omitted.

Main entry points: [`src/gui/gui-main.cpp`](https://github.com/sribalan98/ghostframe-win/blob/main/src/gui/gui-main.cpp) (Desktop GUI), [`src/core/affinity-controller.cpp`](https://github.com/sribalan98/ghostframe-win/blob/main/src/core/affinity-controller.cpp) (Affinity controller), [`src/ui/hider-dock.cpp`](https://github.com/sribalan98/ghostframe-win/blob/main/src/ui/hider-dock.cpp) (Window hider dock), [`src/core/window-manager.cpp`](https://github.com/sribalan98/ghostframe-win/blob/main/src/core/window-manager.cpp) (Window discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_gui["Desktop GUI<br/>[gui-main.cpp]"]
  node_theme["GUI theme<br/>[gui-theme.hpp]"]
  node_obs["OBS dock plugin<br/>[plugin-main.cpp]"]
  node_dock["Window hider dock<br/>[hider-dock.cpp]"]
end

subgraph group_control["Window control"]
  node_windows["Window discovery<br/>[window-manager.cpp]"]
  node_windowinfo["Window records<br/>[window-info.hpp]"]
  node_affinity["Affinity controller"]
  node_rules["Auto-hide rules<br/>[config-manager.cpp]"]
end

subgraph group_injection["Affinity injection"]
  node_helper["Process helper<br/>[helper-main.cpp]"]
  node_payload["Remote payload<br/>[payload.cpp]"]
end

node_user(("User"))
node_dwm["Windows capture compositor"]

node_user -->|"manages windows"| node_gui
node_gui -->|"renders with"| node_theme
node_gui -->|"enumerates windows"| node_windows
node_gui -->|"toggles exclusion"| node_affinity
node_gui -->|"edits rules"| node_rules
node_windows -->|"returns records"| node_windowinfo
node_affinity -->|"checks processes"| node_windows
node_affinity -->|"launches helper"| node_helper
node_helper -->|"loads payload"| node_payload
node_affinity -->|"sets capture affinity"| node_dwm
node_obs -->|"creates dock"| node_dock
node_dock -.->|"manages windows"| node_windows
node_dock -.->|"toggles exclusion"| node_affinity
node_dock -.->|"edits rules"| node_rules

click node_gui "https://github.com/sribalan98/ghostframe-win/blob/main/src/gui/gui-main.cpp"
click node_theme "https://github.com/sribalan98/ghostframe-win/blob/main/src/gui/gui-theme.hpp"
click node_obs "https://github.com/sribalan98/ghostframe-win/blob/main/src/plugin-main.cpp"
click node_dock "https://github.com/sribalan98/ghostframe-win/blob/main/src/ui/hider-dock.cpp"
click node_windows "https://github.com/sribalan98/ghostframe-win/blob/main/src/core/window-manager.cpp"
click node_windowinfo "https://github.com/sribalan98/ghostframe-win/blob/main/src/core/window-info.hpp"
click node_affinity "https://github.com/sribalan98/ghostframe-win/blob/main/src/core/affinity-controller.cpp"
click node_rules "https://github.com/sribalan98/ghostframe-win/blob/main/src/core/config-manager.cpp"
click node_helper "https://github.com/sribalan98/ghostframe-win/blob/main/src/helper/helper-main.cpp"
click node_payload "https://github.com/sribalan98/ghostframe-win/blob/main/src/helper/payload.cpp"

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_gui,node_theme,node_obs,node_dock,node_user toneBlue
class node_windows,node_windowinfo,node_affinity,node_rules toneAmber
class node_helper,node_payload toneMint
class node_dwm toneIndigo
```

## Components

### User interfaces

- [Desktop GUI](https://github.com/sribalan98/ghostframe-win/blob/main/src/gui/gui-main.cpp): `src/gui/gui-main.cpp`
- [GUI theme](https://github.com/sribalan98/ghostframe-win/blob/main/src/gui/gui-theme.hpp): `src/gui/gui-theme.hpp`
- [OBS dock plugin](https://github.com/sribalan98/ghostframe-win/blob/main/src/plugin-main.cpp): `src/plugin-main.cpp`
- [Window hider dock](https://github.com/sribalan98/ghostframe-win/blob/main/src/ui/hider-dock.cpp): `src/ui/hider-dock.cpp`

### Window control

- [Window discovery](https://github.com/sribalan98/ghostframe-win/blob/main/src/core/window-manager.cpp): `src/core/window-manager.cpp`
- [Window records](https://github.com/sribalan98/ghostframe-win/blob/main/src/core/window-info.hpp): `src/core/window-info.hpp`
- [Affinity controller](https://github.com/sribalan98/ghostframe-win/blob/main/src/core/affinity-controller.cpp): `src/core/affinity-controller.cpp`
- [Auto-hide rules](https://github.com/sribalan98/ghostframe-win/blob/main/src/core/config-manager.cpp): `src/core/config-manager.cpp`

### Affinity injection

- [Process helper](https://github.com/sribalan98/ghostframe-win/blob/main/src/helper/helper-main.cpp): `src/helper/helper-main.cpp`
- [Remote payload](https://github.com/sribalan98/ghostframe-win/blob/main/src/helper/payload.cpp): `src/helper/payload.cpp`

### Other components

- **User**
- **Windows capture compositor**

## Connections

- User → Desktop GUI: manages windows (evidence: `README.md`)
- Desktop GUI → GUI theme: renders with (evidence: `src/gui/gui-main.cpp`)
- Desktop GUI → Window discovery: enumerates windows (evidence: `src/gui/gui-main.cpp`)
- Desktop GUI → Affinity controller: toggles exclusion (evidence: `src/gui/gui-main.cpp`)
- Desktop GUI → Auto-hide rules: edits rules (evidence: `src/gui/gui-main.cpp`)
- Window discovery → Window records: returns records
- Affinity controller → Window discovery: checks processes (evidence: `src/core/affinity-controller.cpp`)
- Affinity controller → Process helper: launches helper (evidence: `src/core/affinity-controller.cpp`)
- Process helper → Remote payload: loads payload (evidence: `src/helper/helper-main.cpp`)
- Affinity controller → Windows capture compositor: sets capture affinity (evidence: `README.md`)
- OBS dock plugin → Window hider dock: creates dock (evidence: `src/plugin-main.cpp`)
- Window hider dock → Window discovery: manages windows
- Window hider dock → Affinity controller: toggles exclusion
- Window hider dock → Auto-hide rules: edits rules
