D
Dootje
I am trying to control a piece of third-party software from a home-made
Access (VBA) application. The third-party software scans a document that is
subsequently processed by the VBA code. My problem is that the VBA code and
the scanning run asynchronously (of course), but that VBA has to wait until
the scanning has finished before it can process the image. Calling Shell and
waiting for the process to end is no option, because the scanner software is
TSR. The scanner software is, of course, a black box to me as far as event
triggering is involved.
So far I have tried using an ActiveX TWAIN object in lieu of the scanner
software itself, but the free demos I found all have trouble communicating
with the scanner (it's not one of the newest, maybe that's why - though it
works flawlessly under its own user interface).
The workaround that I am thinking of involves checking for scanner activity:
while it is scanning, the scanner software displays a message window on the
screen. This message window is associated with a specific DLL that is loaded
when scanning begins, and is unloaded when scanning has terminated. Since it
is a message window, I can't track it with EnumChildWindows, but I have seen
software that can track not only child windows but also modules and threads
(WinProcesses to be specific). Now how do I do that in VBA? Googling several
hours did not get me anywhere, possibly because I don't know the right
search terms. FYI, I am using MS Access 2002 under XP Home SP2.
Thanks in advance to anyone who bothers to reply. Any help is appreciated.
Dootje
Access (VBA) application. The third-party software scans a document that is
subsequently processed by the VBA code. My problem is that the VBA code and
the scanning run asynchronously (of course), but that VBA has to wait until
the scanning has finished before it can process the image. Calling Shell and
waiting for the process to end is no option, because the scanner software is
TSR. The scanner software is, of course, a black box to me as far as event
triggering is involved.
So far I have tried using an ActiveX TWAIN object in lieu of the scanner
software itself, but the free demos I found all have trouble communicating
with the scanner (it's not one of the newest, maybe that's why - though it
works flawlessly under its own user interface).
The workaround that I am thinking of involves checking for scanner activity:
while it is scanning, the scanner software displays a message window on the
screen. This message window is associated with a specific DLL that is loaded
when scanning begins, and is unloaded when scanning has terminated. Since it
is a message window, I can't track it with EnumChildWindows, but I have seen
software that can track not only child windows but also modules and threads
(WinProcesses to be specific). Now how do I do that in VBA? Googling several
hours did not get me anywhere, possibly because I don't know the right
search terms. FYI, I am using MS Access 2002 under XP Home SP2.
Thanks in advance to anyone who bothers to reply. Any help is appreciated.
Dootje