0

Background

I want to make my question as specific as possible but still give a broad background of why I'm asking... My goal is to create a brand new cross platform application which incorporates fingerprint recognition via the use of a reasonably high quality / accurate scanner. The requirements state that the application must allow lots of people to quickly be identified in quick succession (e.g. a line at a checkout). As well as do other stuff like communicate with a cloud based app etc...

I acquired a reasonably priced scanner (USB Hamster Pro 20 - Secugen) and obtained the .NET SDK and device drivers from the hardware vendor.

Initially I had imagined a Xamarin app but since device drivers are only available for Windows, Linux and Android I thought I would just settle for Windows. And as its a brand new app why not use UWP and take the benefits of UWP and Windows Store etc... . I want to develop this application in C#.NET and ideally target something like a surface pro tablet.

Upon inspection of the 3rd party dll provided with the SDK, I noticed that to enable Auto-On (event based scanning), a method signature requires the handle of the window which will receive the message of the event from the device driver. The docs say to override WndProc of the receiving "window" to handle the events.

Question

With this SDK(dll) am I forced to use WinForms or WPF? Is there something fancy I can do to capture these events from within a UWP or Console app?

Similar Questions

During my research, I found these similar questions on SO and (I think) they suggest that UWP is out of the question.

Message pump in .NET Windows service

How to receive simplest Windows message on UWP XAML MVVM app?

Community
  • 1
  • 1
Jon
  • 162
  • 15

1 Answers1

2

UWP cannot receive window event messages, request your vendor to provide a library targeting UWP.

Or, more practical, I would suggest doing this in two steps,

First write a WinForm/WPF app that handles the scanner messages (by overriding WndProc), the window can be hidden so user won't even know there is another desktop app running.

After the WinForm/WPF is finished, wire it up with the UWP app, using various communication channels between a classic desktop application and a UWP app.

kennyzx
  • 12,257
  • 6
  • 33
  • 75
  • Vendor request sent. Not hopeful though.Does your suggestion of wiring up a WPF and UWP introduce much complexity when it comes to packaging and deployment? I'm considering just a standalone WPF application now in order to keep it simple... – Jon Jul 12 '17 at 00:52
  • @Jon if the UWP app is side-loaded (the app is not deployed via Windows Store but installed directly with an installer), it is not difficult to pack both WPF and UWP into a single setup installer. The UWP can be installed using a powershell script, I have packed in this way using Inno-Setup successfully. – kennyzx Jul 12 '17 at 02:23
  • I see. Although I'm now wondering if in side-loading, I would be losing the main benefits of UWP (which for me were mainly the store)... I can't see why I would go to the trouble of packing two things into one, when I could just create a WPF app. You have avoided a lot of googling on my side, thanks – Jon Jul 12 '17 at 05:14
  • @Jon the good news is you can utilize the Store to distribute a traditional desktop application like WPF, using a converter called Desktop bridge, although I myself have not tried it out. But for your case, the most beautiful tool for distributing a WPF application is ClickOnce, I have seen dozens of thousands of downloads of my ClickOnce application without hitting any error. – kennyzx Jul 12 '17 at 05:20