Shaul Zuarets
Shaul Zuarets

Reputation: 849

Can Electron access Windows API - serial communication, printers and dual screen app

We are thinking about redeveloping our WPF based application in Electron.

After a lot of reading, we have realised that Electron will be great for us not because of it's cross-platform ability, but because we can unite our entire stack on the same technology (mostly Angular 5). I wanted to know if someone had the experience to use Electron on Windows with the next OS (Windows) API's:

  1. Use several printers at the same time and programmatically choose a specific printer.
  2. Communicate with a device using serial communication.
  3. Our application needs to display 2 different screens (on 2 different monitors) at the same time. Is it possible?

I know that I can use .net/C++ apps just for the windows API, is it easy and seamless (from a user perspective) to do that?

Thanks! Shaul

Upvotes: 5

Views: 5020

Answers (1)

Tim
Tim

Reputation: 8176

  1. Use several printers at the same time and programmatically choose a specific printer.

Recent versions of Electron (>=1.7) allow you to list printers and print to specific ones. The only limitation we've found is that there is no way to force landscape through the electron API's.

  1. Communicate with a device using serial communication.

Yes this is possible. We do it using the serialport library.

  1. Our application needs to display 2 different screens (on 2 different monitors) at the same time. Is it possible?

Yes this is possible as it works like any other app. You could either drag the Window across two screens or create two windows and maximise them on each screen. You can even use the Electron screen API to list the screen and get their positions and dimensions.

One possible issue with multiple windows to be aware of is that each window runs in its own process which can make communication between them trickier but not impossible.

Upvotes: 4

Related Questions