WPF Handle Problem for RfidButtonClick

WPF Handle Problem for RfidButtonClick

Hi,

I have problem with handle of my screen. I am developing my project on WPF platform. But, WPF platform does not support handle. How can I call RFIDButtonClick eventhandler?

That is an example with Windows.Forms:

btnIntelMCA = new Intel.Healthcare.Device.Buttons(this.handle);

btnIntelMCA.RfidButtonClick += new EventHandler(btnIntelMCA_RfidButtonClick);

But unfortunately in my screen (.xaml) you cannot call this.handle. Does it anyway to do this?

Also, I used System.Windows.Forms.Integration.WindowsFormsHost control in my .Xaml (System.Windows.Window)

to use my camera. I designed a frmCamera : Windows.Forms.formForm with a panel. Then I handled this panel.( oCamera.StartPreview(panel.Handle); ) After that I inserted this form in my WPF Screen with WindowsFormsHost. This procedure worked! But, you cannot handle RFID form with IntelMCA button (ex.Shift+F2) with following above procedure.

Thanks.

Unsal Donmez

11 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hello Unsal,

Unfortunately, XAML wasnt a consideration when we created the MCA SDK. I am waiting for some more input from our development team, but from what we can determine there isnt an easy way to get a handle for XAML. If you cannot get a handle for the window, then there is not much you will be able to do with the MCA SDK since the window handle is a required parameter. You may be on you own in this area unless some of the other developers in the forum have some suggestions for you.

-Steve

This may help you, or it may not be applicable to your application.

http://www.codeproject.com/useritems/XamlWindowsInCAB.asp

Hi Steve,

Thank you very much for your reply.
I will be waiting suggestions and input results from your team.

Unsal

Hi Steve,

Is there any development or suggestions for handle problem of .xaml, I have not still able to handle my program with MCA's buttons, which were located top on the MCA. I have worked RFID and Barcode just only with my button located on my application.

I am looking forward to hearing you.

Best regards

Happy New Year

Unsal

Hi Unsal,

Unfortunately, we do not have a solution today for .xaml. Our development team is looking at supporting.xaml in the future, but have not made a commitment on it yet.

-Steve

Hi Steve,

thank you anyway your help and responses.

I solved handle problem in WPF.

You can solve handle problem of WPF using below code block:

(new WindowInteropHelper(window)).Handle

... to get the IntPtr hwnd of your main window.

Thanks.

Unsal Donmez

Hi,

I have used the method you mentioned above. However, the preview will cover the window totally and overlap my buttons.

Is there a solution to still have my buttons on that window?

Looking forward to your reply.

Thanks,
Wendy K

Hi all,

Here's the solution For WPF Application.

The problem which i faced was, while instantiating the object of the Intel.Healthcare.Device.Buttons btn,its constructor requires a handle value of the active window as a parameter. This handle value is directly available in traditional windows forms, but for WPF window we need to add the following line

[c-sharp]WindowInteropHelper helper = new WindowInteropHelper(this);
btn = new Buttons(helper.Handle);
[/c-sharp]

But still unlike traditional windows forms this value is not accessible within the windows constructor scope, as the window is not completely instantiated, hence every time it returns zero value.
This problem has been resolved as the handle value for the window is available after the constructor is completely executed.

Quoting - ISN Admin
Hi Steve,

thank you anyway your help and responses.

I solved handle problem in WPF.
You can solve handle problem of WPF using below code block:

(new WindowInteropHelper(window)).Handle
... to get the IntPtr hwnd of your main window.

Thanks.

Unsal Donmez

This worked for me, thanks!

Quoting - rchautel

Hi all,

Here's the solution For WPF Application.

The problem which i faced was, while instantiating the object of the Intel.Healthcare.Device.Buttons btn,its constructor requires a handle value of the active window as a parameter. This handle value is directly available in traditional windows forms, but for WPF window we need to add the following line clothes fashion korean wholesale fashion fashion korean wholesale fashion models garment.

[c-sharp]WindowInteropHelper helper = new WindowInteropHelper(this);
btn = new Buttons(helper.Handle);
[/c-sharp]

Movie film phim phim online viet entertainment phim han quoc drama clips. Actors actresses phim hong kong film enjoy. Movie clips korean drama for entertainment. But still unlike traditional windows forms this value is not accessible within the windows constructor scope, as the window is not completely instantiated, hence every time it returns zero value.
This problem has been resolved as the handle value for the window is available after the constructor is completely executed.

Wonderful just wondeful solution. I've been looking all night for this. Thanks for your greatwork.

Leave a Comment

Please sign in to add a comment. Not a member? Join today