---
title: "oneplatform cookbook"
url: https://recursiveai.org/oneplatform/cookbook/
description: "7 OnePlatform recipes, each with complete code."
version: "1.0.0"
---

# oneplatform cookbook

## Recipes

- [Create a native desktop window in C#](https://recursiveai.org/oneplatform/cookbook/create-native-cross-platform-window/index.md): Open a native desktop window from a C# console project. Pump window events and exit cleanly on close, without a Windows-only project type.
- [Simulate mouse and keyboard input in headless C# tests](https://recursiveai.org/oneplatform/cookbook/test-window-input-headlessly/index.md): Inject clicks, key presses, and typed text into an in-process C# test window, then check the events without opening a desktop window.
- [Handle per-monitor DPI scaling in C#](https://recursiveai.org/oneplatform/cookbook/handle-per-monitor-dpi/index.md): Convert a native window’s physical pixels to logical units in C#. Update your layout when its scale changes and keep drawing at the real pixel size.
- [Copy and paste system clipboard text in cross-platform C#](https://recursiveai.org/oneplatform/cookbook/read-write-system-clipboard-text/index.md): Read and write Unicode text on the system clipboard in a C# desktop app. Keep the event loop running so other apps can paste your text.
- [Create an always-on-top overlay window in C#](https://recursiveai.org/oneplatform/cookbook/create-always-on-top-overlay/index.md): Create a borderless, always-on-top overlay in C# with OnePlatform. Set its size and screen position, and see which desktop settings apply.
- [Use a canvas as a .NET WebAssembly window](https://recursiveai.org/oneplatform/cookbook/host-dotnet-wasm-window-on-canvas/index.md): Use an HTML canvas as a .NET WebAssembly window. Register OnePlatform’s bundled JavaScript module before running C#, then open the example in a browser.
- [Wake a native event loop from a background thread in C#](https://recursiveai.org/oneplatform/cookbook/wake-native-event-loop-from-worker/index.md): Wake a blocking native event loop from a background thread in C#. Queue the worker’s result and use OnePlatform Wake to signal the main thread without polling.
