we use a terminal emulator called facetwin to run our main unix based applications
we want to attach a small document scanner and magnetic strip reader to the system this runs on
currently we have a magnetic reader that emulates a keyboard so it sends keystrokes back to the unix app. however the new scanner does not.
i can get around this by having the unix app send a special command that facetwin understands so it tells the local windows machine to run my vb application that controls the small document scanner
my vb app then sendkey's back the relevant info.
this is all great and works fine, yet i have a problem
there are 3 copies of facetwin running at anyone time all are logged in as the same user but maybe processing diferent things.
i need to find a way to know which open copy of facetwin just called my application so i can sendkeys back to the right one.
since thay logged in is the same user and the only thing the unix system knows thats unique i need a way for vb to know which facetwin windows called it, maybe fine it's pid or something
doesn anyone have any idea's how i might do something like this.
I have 2 idea's that might work to do what i want but there might be an easier way i dont know about.
1. Wrapper
I'm thinking that i could place some sort of wrapper arround the application as it runs.
then when it makes it's call i can intercept and know which open window make the call.
problem : never done anything remotly like it, not sure how to make the wrapper.
2. Background Application
Application that running in the background on the workstation all the time.
have the terminal windows make the call to the background app
have the app remain in the background and get the pid of the current window in focus on the workstation
pass the pid off to my scanner app.
problem : making sure the background app does not become in focus when it's called
problem 2 : finding the in focus window on the windows system (it's fairly easy to find it in your own app, but not sure how to find it when it's another app.)
thanks