Reputation: 54117
We have a third party Windows application that we feel is too complex for our users to use efficiently. The application manages a scanner that we're using to scan 3000 documents per day.
The scanner application can be completely piloted using the keyboard.
We are therefore in the process of writing a simple WinForms application that has a small number of large buttons on it that uses SendKeys
and some Win32 API calls to send keystrokes to the scanner application. We plan to make this WinForms application full screen and set to the top of the Z-Order.
However, the scanner application sometimes displays error messages in modal dialogs (e.g. scanner paper jam etc). We need to show these error messages in our WinForms application.
Can anyone suggest a technique that will allow us to capture these error messages and show them to our users?
Upvotes: 1
Views: 683
Reputation: 22020
Not sure if this is the most efficient way, but assuming you have a way to identify those error messages, you can have a loop that will go over all open windows every once in a while, and look for one of those error windows.
Another possible direction to explore is to inject a dll of yours into the other app, and watch the messages passed. I can't say for sure you'll be able to identify those messages and I can't do further research at the moment, but I believe it should be possible. Just Spy++ the other app when such message is popped, and identify the relevant messages.
Upvotes: 2