I am writing a C# dll for barcode scanner that emulates keyboard. I am fighting with this for some time. I have problems with raw input. All examples that i found require MainApplication window handle. How to attach to device and get scanned barcode without it. Second problem is that i have to know from which keyboard it was sent from.
I tried to get it using this:
It gets me data and device name but require window handle.
For me problem is in this part of code:
IntPtr p = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle; System.Windows.Interop.HwndSource source =System.Windows.Interop.HwndSource.FromHwnd(p);
MainWindowHandle is somethig that i do not have. And I cannot attach to windows messages. Answer to that will work for me
Do you have any ideas?
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)