VintaSoft Twain .NET SDK Discussions

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Board index < VintaSoft Twain < VintaSoft Twain .NET SDK Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

Losing Window Focus



Losing Window Focus

Post by mrnate »

Hello,

I am using the sample code, specifically the AcquireImageModal routine, and my application loses focus after acquiring an image.

I am activating the main form after the image is acquired, but it still results in a flashing window (losing focus, then activating)

Is there something that can be done to remedy this behavior?



Thanks,
Nate


Re: Losing Window Focus

Post by Alex »

Hello Nate,

What TWAIN driver do you use?

Best regards, Alexander


Re: Losing Window Focus

Post by mrnate »

I'm using the 32bit CanoScan 9000F Mark II driver


Re: Losing Window Focus

Post by mrnate »

aha, I figured out the culprit.

I am disabling the form (effectively disabling all the controls) and then re-enabling the form before/after the image acquisition. That must be messing with the Window handle being passed to the TWAIN driver?

Once I remove that, everything works as expected.

Thanks!


Re: Losing Window Focus

Post by Alex »

Thank you for information.

How do you initialize instance of DeviceManager class? Do you pass the WinForm object or windows handle to the constructor of DeviceManager class?
Please pass information about parent window to the constructor of DeviceManager class and this also may solve the problem.

Best regards, Alexander


Re: Losing Window Focus

Post by mrnate »

using (DeviceManager deviceManager = new DeviceManager(this))


Re: Losing Window Focus

Post by Alex »

using (DeviceManager deviceManager = new DeviceManager(this)) This is correct code. I think your solution with disabling/enabling UI is the best solution for your TWAIN driver.

Best regards, Alexander


Page 1 from 1: 1