oneplatformCookbook
oneplatform cookbook
Recipes
Create a native desktop window in C#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# testsInject 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#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#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#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 windowUse 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#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.