# topsoftdeveloper/remotehiddendesktop architecture

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

- Interactive diagram: https://gitdiagram.com/topsoftdeveloper/remotehiddendesktop
- Repository: https://github.com/topsoftdeveloper/remotehiddendesktop

## Overview

KHVNC implements remote control of a hidden Windows desktop, with native and Python client variants. The principal workflow is a client connection to the server, transmission of desktop images for display, and return of operator input to the remote session; the README also documents app and browser launching. The sampled source supports the server’s image-receive/display and input-command handling, but does not expose the full native client or hidden-desktop implementation, so those links are limited to documented behavior. The Python client’s detailed runtime wiring is also only partially sampled.

Main entry points: [`Server/Server.cpp`](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Server/Server.cpp) (Server Runtime), [`PyClient/main.py`](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/PyClient/main.py) (Python Client), [`Client/Main.cpp`](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Client/Main.cpp) (Native Client), [`Client/HiddenDesktop.cpp`](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Client/HiddenDesktop.cpp) (Desktop Session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Control Server"]
  node_server_main["Server Startup<br/>[Main.cpp]"]
  node_server_runtime["Server Runtime<br/>[Server.cpp]"]
  node_control_window["Control Window<br/>[ControlWindow.cpp]"]
end

subgraph group_desktop["Hidden Desktop"]
  node_desktop_client["Native Client<br/>[Main.cpp]"]
  node_hidden_desktop["Desktop Session<br/>[HiddenDesktop.cpp]"]
  node_native_capture["Image Capture<br/>[HiddenDesktop.cpp]"]
  node_native_input["Input Handling<br/>[HiddenDesktop.cpp]"]
end

subgraph group_pyclient["Python Client"]
  node_py_main["Python Client<br/>[main.py]"]
  node_py_desktop["Python Desktop<br/>[virtualdesktop.py]"]
  node_py_bitmap["Bitmap Processing<br/>[bitmap.py]"]
  node_py_compress["Compression<br/>[compress.py]"]
  node_py_process["App Launching<br/>[processmanage.py]"]
end

subgraph group_runtime["Shared Runtime"]
  node_protocol["Socket Protocol<br/>[HTTP.cpp]"]
  node_api["Windows API Bindings<br/>[Api.cpp]"]
end

node_operator(("Operator"))
node_network{{"Network"}}
node_remote_apps["Remote Applications"]

node_operator -->|"controls"| node_control_window
node_server_main -->|"starts"| node_server_runtime
node_server_runtime -->|"displays frames"| node_control_window
node_server_runtime -->|"accepts connections"| node_network
node_desktop_client -->|"connects"| node_network
node_network -->|"transfers frames"| node_server_runtime
node_control_window -->|"dispatches input"| node_server_runtime
node_server_runtime -->|"sends input"| node_network
node_network -->|"delivers input"| node_native_input
node_hidden_desktop -->|"captures screen"| node_native_capture
node_native_capture -->|"sends images"| node_network
node_hidden_desktop -.->|"hosts applications"| node_remote_apps
node_py_main -.->|"connects"| node_network
node_py_main -.->|"starts session"| node_py_desktop
node_py_main -.->|"uses images"| node_py_bitmap
node_py_main -.->|"compresses frames"| node_py_compress
node_py_main -.->|"launches apps"| node_py_process
node_desktop_client -->|"starts session"| node_hidden_desktop
node_desktop_client -->|"initializes bindings"| node_api

click node_server_main "https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Server/Main.cpp"
click node_server_runtime "https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Server/Server.cpp"
click node_control_window "https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Server/ControlWindow.cpp"
click node_desktop_client "https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Client/Main.cpp"
click node_hidden_desktop "https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Client/HiddenDesktop.cpp"
click node_native_capture "https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Client/HiddenDesktop.cpp"
click node_native_input "https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Client/HiddenDesktop.cpp"
click node_py_main "https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/PyClient/main.py"
click node_py_desktop "https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/PyClient/virtualdesktop.py"
click node_py_bitmap "https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/PyClient/bitmap.py"
click node_py_compress "https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/PyClient/compress.py"
click node_py_process "https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/PyClient/processmanage.py"
click node_protocol "https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/common/HTTP.cpp"
click node_api "https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/common/Api.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_server_main,node_server_runtime,node_control_window toneBlue
class node_desktop_client,node_hidden_desktop,node_native_capture,node_native_input toneAmber
class node_py_main,node_py_desktop,node_py_bitmap,node_py_compress,node_py_process toneMint
class node_protocol,node_api toneRose
class node_operator,node_network,node_remote_apps toneIndigo
```

## Components

### Control Server

- [Server Startup](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Server/Main.cpp): `Server/Main.cpp`
- [Server Runtime](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Server/Server.cpp): `Server/Server.cpp`
- [Control Window](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Server/ControlWindow.cpp): `Server/ControlWindow.cpp`

### Hidden Desktop

- [Native Client](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Client/Main.cpp): `Client/Main.cpp`
- [Desktop Session](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Client/HiddenDesktop.cpp): `Client/HiddenDesktop.cpp`
- [Image Capture](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Client/HiddenDesktop.cpp): `Client/HiddenDesktop.cpp`
- [Input Handling](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/Client/HiddenDesktop.cpp): `Client/HiddenDesktop.cpp`

### Python Client

- [Python Client](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/PyClient/main.py): `PyClient/main.py`
- [Python Desktop](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/PyClient/virtualdesktop.py): `PyClient/virtualdesktop.py`
- [Bitmap Processing](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/PyClient/bitmap.py): `PyClient/bitmap.py`
- [Compression](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/PyClient/compress.py): `PyClient/compress.py`
- [App Launching](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/PyClient/processmanage.py): `PyClient/processmanage.py`

### Shared Runtime

- [Socket Protocol](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/common/HTTP.cpp): `common/HTTP.cpp`
- [Windows API Bindings](https://github.com/topsoftdeveloper/remotehiddendesktop/blob/main/common/Api.cpp): `common/Api.cpp`

### Other components

- **Operator**
- **Network**
- **Remote Applications**

## Connections

- Operator → Control Window: controls
- Server Startup → Server Runtime: starts
- Server Runtime → Control Window: displays frames
- Server Runtime → Network: accepts connections
- Native Client → Network: connects
- Network → Server Runtime: transfers frames
- Control Window → Server Runtime: dispatches input
- Server Runtime → Network: sends input
- Network → Input Handling: delivers input
- Desktop Session → Image Capture: captures screen
- Image Capture → Network: sends images
- Desktop Session → Remote Applications: hosts applications
- Python Client → Network: connects
- Python Client → Python Desktop: starts session
- Python Client → Bitmap Processing: uses images
- Python Client → Compression: compresses frames
- Python Client → App Launching: launches apps
- Native Client → Desktop Session: starts session
- Native Client → Windows API Bindings: initializes bindings
