The Onscryn SDK: build apps made for streaming
7 min read
Onscryn can stream almost any Windows application without touching it. If you own the source, you can do better. Link the Onscryn SDK into your app and it stops being something that is watched from the outside and becomes something that takes part: it hands over its own picture, receives input directly, publishes what is on screen, and exposes functions that workflows can call.
What the SDK is
The SDK is a native library, Onscryn.Capture.dll, with a flat C interface. You call it from C or C++ through the header, and from .NET or any other language that can call a C library. There is nothing to run beside your app: the library loads into your app's own process and talks to the Onscryn agent on the host.
Your app keeps doing what it does. It draws its own windows and runs its own logic. The SDK adds a small set of calls for the parts that matter once an app is streamed: sending frames, taking input, and talking to the browser and to automation.
What a linked app gets
Each of these is a call or a callback in the SDK, covered in its own page.
- Frames from the app itself. The app tells Onscryn what it drew and what changed, instead of being screen-scraped.
- Input delivered into the app's own window. Browser mouse and keyboard events are posted straight to it, with no glue code needed by default.
- A live UI tree. The SDK reads the app's controls through UI Automation and publishes them, which powers selectable text, search and the workflow builder's element picker.
- Named actions. Register functions such as getOrder or approveInvoice and workflows, webhooks and schedules can call them by name and get a JSON result back.
- Files, links and the clipboard. Send a PDF or a link to the user's browser, receive uploads and drag-and-drop files, and sync clipboard text.
- Browser printing, cursor shape and image, screenshots, suspend and resume, and the viewer's screen size and language.
SDK app or generic capture
When you register an application you choose how it is captured. Generic capture needs no cooperation from the app, which is why it suits software you did not write. An SDK app cooperates, which is why it can do more. Neither changes how the app is licensed.
The table below is the practical difference. If you can modify the app and you want automation, files or printing that feel native, use the SDK. If you cannot touch the source, use generic capture and still get a UI tree and workflows.
| SDK app | Generic capture | |
|---|---|---|
| Changes to your app | You link the library and add a few calls | None. The app is untouched |
| How the picture is made | The app hands over its own window picture | The agent captures the app's window from outside |
| Mouse and keyboard | Posted into the app's own window by the SDK | Sent in by the agent from outside |
| UI tree for workflows | Read from inside the app | Read from outside the app |
| Named actions | Yes: workflows call functions you register | No: workflows click and type |
| Files, links and clipboard from the app | Direct calls: SendFile, OpenUrl, SendClipboard | Through the viewer's own upload, download and clipboard controls |
| Best for | Software you build or can modify | Software you cannot change |
| Licensing | Unchanged: Windows and the app still need their own licences | Unchanged: Windows and the app still need their own licences |
How the pieces fit
At runtime the Onscryn agent on your Windows host starts your app in a session of its own and passes it an instance id. Your app starts the SDK with that id, and the SDK connects back to the agent. From then on frames flow out to the browser, and input and action calls flow in.
The picture and the people
01
Your app, with the SDK
Draws its own window and hands the picture over.
02
Onscryn on your host
Streams it and applies your clipboard, file and watermark rules.
03
A browser tab
Shows the app. Mouse, keys, uploads and drops go back.
Automation
01
A workflow, webhook or schedule
Runs on demand or on a timer.
02
Onscryn
Starts a session, even with no browser attached.
03
A named action in your app
A function you registered. Returns JSON.
What you need
Before you start:
- A Windows host enrolled in your organization. See the Hosts page if you have not enrolled one yet.
- The SDK package: Onscryn.Capture.dll, Onscryn.Capture.lib and the header onscryn_capture.h. It is 64-bit, so your app must be 64-bit too.
- A Windows app you can modify, written in C, C++, C#, VB.NET or anything else that can call a C library.
- A development machine with Windows. The SDK uses Win32, so it does not build or run elsewhere.
The SDK package is provided on request. Email [email protected] and tell us what you are building.
What the SDK does not change
It does not remove the need for licences. Windows, your database client and your own software are licensed the same way as before, and the Windows licensing guide covers the questions to ask. It also does not redraw your interface: the app still paints itself, and what the browser sees is that picture.