Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
3.80/5 (3 votes)
I have developed a rather advanced product that does various recognition OCR / LPR type of images and video.

I am hung up on something that seems rather simple in nature. I have 4 text fields that I need to feed to an external application. As usual this application is proprietary and I can't integrate with it in the preferred manor. That leaves me using a less than desireable option like sendkeys or something of the like.

I have been looking at it in spy++ etc, but it seems a bit wierd.
The class of the page in question shows up as Internet_Explorer_Server. From what I can tell the application seems to use html pages under the covers and ifragistics controls in some places. I know at one time I did some pinvoke work with mediaplayer and was able to control things in a more formal manner by sending windows messages.

I can't seem to find any messages or anything that make sense. I want to do something more than force keys and pray. Any ideas ?
Posted

 
Share this answer
 
First of all, I would question the whole idea of feeding any data to an external application. Even though it can be appropriate in some very special product (such as system utilities), it could not be considered as a legitimate way of "integration". Processes are well isolated, and, if they are not designed for one or another mechanism of collaboration, forcing them to do one or another thing by simulation of user input will also be a kind of dirty business; you cannot expect reliable and maintainable results.

Besides, Windows messaging mechanism is not a reliable way of such simulation. This mechanism is Windows-specific, based on obsolete Windows architecture (when it comes to exchanging messages between different processes) and is not used by all applications. Controls don't have to be windowed controls, and, in case, for example, of WPF and other architectures based on DirectX, won't be.

The only universal way of simulation of user input is the Windows API SendInput: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310%28v=vs.85%29.aspx[^].

Is always works as expected just because its low level; it works pretty much as the device drivers do when they send raw input (drivers, at least in some Windows version, used the functions keybd_event and mouse_event which you should not use, because they have been superseded by SendInput). The usage is quite simple and always reliable, tested.

—SA
 
Share this answer
 
Update:
I would agree with Sergey Alexandrovich Kryukov that no way is it the right thing to do. The correct thing to do would be to use the spillman sdk to integrate with them. However after two years of failed attempts to get the sdk, this is what I am stuck with. At this point I am so frustrated with the company, I would just about rather right my own, and create some competition to their old product that they are so protective of.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900