- Topics - 9
- Replies - 583
- Total Posts - 592
Or things like papers not found message box pops up,
you don’t like the vendor’s messagebox stopping your triplet? No kidding. That’s frustrating. No, there is no twain call to turn them off.
I want that message transfered to my app, where I would show the message in a level or own messgebox. all the messages generated from a user command to the scanner to be captured by my app just that what I want.
Unfortunately those messages aren’t always available, and there really isn’t a way (from within the twain spec) to get them trasnfered to your app.
My workaround ended up being a second thread that does dialog management for me. I set a shell hook and a second cbt hook for windowactivated/created. then I have the users do stupid stuff like turn off the scanner and try to acquire, or jam a paper in the feeder before trying to acquire. typically you’ll have to watch for the dialogs around the time you call openDs, enableDs or enableDsUiOnly. If any dialogs come up that second thread steps thru it and gathers details to base a rule on for the dialog monitor. In general use the dialog monitor will have an array of meesagesboxes to watch out for and what to do if they show up – usually a postmessage to the ok or Cancel buttons. Worst case is if the users havent made rules for all of the possible messageboxes but the details are logged. When the cbthook catches the dialog you don’t even see it, just hear the beep. The shellhook isn’t as fast – you’ll often see a flash of messagebox before it gets closed.
Once you have that out of the way you’re able to go back to work on the rest of the spec, but I’d have to say that dialog management is key if you’re going to get any production work out of a mid-range scanner.