Home › Forums › TWAIN Classic › modal/modeless Select Source dialog
- This topic has 4 replies, 3 voices, and was last updated 16 years ago by mcscorp.
- AuthorPosts
I am having the weirdest problem – one of my customers reports that the Select Source dialog is not behaving in a fully ‘modal’ way: The main application window can be clicked on, and it then pops forward and covers the Select Source dialog. I was able to easily reproduce this behavior with one of my test programs earlier this afternoon… but when I tried again later (with the same test program) the dialog acts perfectly modal!
I feel like I’ve seen this problem before years ago, but I can’t for the life of me remember any details. None of these programs are doing any disable of the main window. When I use Spy++ to examine the Select Source dialog, it has the app main window as its owner (not parent) – even though the TWAIN call to post the Select Source dialog does not pass any window handle… Anybody know what that’s about? Could the Select Source dialog be calling something like GetForegroundWindow to choose its parent?
Source dialog uses parent window handle passed to source manager, so you should make sure if you pass correct handle (probably there was mistake in getting handle) eg.
twain.loadSourceManager(GetActiveWindow());
srcIndex = twain.selectSource();Wow, a 2+ year old question gets a reply. I think scscorp is talking about the window handle passed in on DG_CONTROL/DAT_PARENT/MSG_OPENDSM.
spike, if you ever figured this problem out please post so others can avoid it.
–Hi mcscorp & dpenney (Doug, is that you?) – mcscorp, thanks for taking the time to post. I was running into this problem inside my EZTwain library, which does a lot of clever 😉 window handle management and caching, so I need to drill down to the bare metal of the TWAIN API to try to reproduce the issue. This has come up *again* with a customer just recently, so I’ll post when I have something new to report.
I had this problem with delphitwain – there was a bug with passing handle to virtual window (yes I mean DG_CONTROL, DAT_PARENT, MSG_OPENDSM). I needed to modify delphitwain source to fix this bug, but it helped (CreateWindow in procedure CreateVirtualWindow needs correct handle instead of 0). I don’t know EZTwain, so I just described my case 😉
- AuthorPosts