onscryn

How to build a Windows app
that streams to a browser.

If you build Windows software, you have probably been told it needs a web rewrite. It does not have to. You can keep the app you have, add a small library, and let people use it in a browser tab. This guide covers when that is the right call, what the work involves, and how to avoid the mistakes that cost the most time.

By the Onscryn team · Published · 8 min read

When this beats a rewrite

A web rewrite is the right answer when you want a new product. It is the wrong answer when you want the existing product in more places. If the app works, the cost of rewriting is the cost of rebuilding every screen, every report and every quirk that users rely on, and then proving it all matches.

Streaming keeps the code, the behavior and the data model. What changes is where the app runs and how people reach it: on a Windows host you control, through a browser tab.

What the integration involves

Five things, in this order.

  • Add the SDK library to your project and declare its calls.
  • Start it once when your main window exists, with the instance id the host passes in.
  • Hand it a picture each time the window changes.
  • Test it on your own machine with a mode that writes frames to files.
  • Register the app on a host and launch it.

The picture and the people

  1. 01

    Your app, with the SDK

    Draws its own window and hands the picture over.

  2. 02

    Onscryn on your host

    Streams it and applies your clipboard, file and watermark rules.

  3. 03

    A browser tab

    Shows the app. Mouse, keys, uploads and drops go back.

Automation

  1. 01

    A workflow, webhook or schedule

    Runs on demand or on a timer.

  2. 02

    Onscryn

    Starts a session, even with no browser attached.

  3. 03

    A named action in your app

    A function you registered. Returns JSON.

The same app serves both: people through the browser, and automation through the functions it chooses to expose.

Two ways to produce the picture

If your app draws itself with GDI, you paint into a surface the SDK gives you and report what changed. If it is built from standard controls, as most WinForms and MFC apps are, you ask Windows to render the window into that surface and send it. The second route is simpler and is what the reference app uses.

Either way, send when something changed, not on a timer, so an idle window costs almost nothing.

Make it feel like a local app

A streamed app is judged by the small things.

  • Set per-monitor DPI awareness before creating any window, so text stays sharp.
  • Tell the viewer which cursor to show, and hit-test as the pointer moves.
  • Handle dialogs and menus. They are separate windows, so composite them into the picture or they will never appear.
  • Use the SDK's file, link and printing calls instead of expecting a desktop that is not there.

What to avoid

Do not block waiting for a person. A modal prompt that only a user at the keyboard can dismiss will stop a headless session. Do not depend on timers or posted messages for work that must run while no browser is attached. And do not call the SDK from a thread that can hang, because a slow caller makes the whole stream stutter.

Test before you deploy

Run the app locally in file-dump mode, open the folder and watch the frames arrive as you click. If they do, your drawing path works. Then register the app on a host and launch it. When something is wrong at that point, it is almost always the DLL location, the 64-bit requirement or the first frame never being presented, and the troubleshooting page covers each.

Related features

Questions.

No. You keep the app and add the SDK. The app runs on a Windows host you control and people use it in a browser tab.

Try it on
your own app.