Link to home
Start Free TrialLog in
Avatar of msaccess
msaccess

asked on

OpenProcess()

I want to execute an external applicationvia VBA's shell() command.  I then want to send keystrokes to that application via VBA's Sendkeys() command.  But before continuing past my Sendkeys() commands -- I want the external application to complete (initiated by the last sendkey() which exits the external application)......

after much painful research I have discovered a VB routine called OpenProcess() which seems to allow the user an option as to how to wait (dead wait via WaitForSingleObject() or active wait by testing with GetExitCodeProcess and doing DoEvents if external application still active).  I found all this out in a very good book called "Hard Core Visual Basic".

My Question....
From within my Windows 95 MS Access VBA routine, can I - and if I can - how exactly do I implement OpenProcess() with a flag to choose the active wait option?  I really need to know all the details -- for example, what I need to declare and code in order for my VBA routine to have at  VB routines and pre-defines such as OpenProcess().  Also, please indicate the syntax and usage of OpenProcess() and any other routines or defines that I need to use.

Thanks very much,
Desperately in search of how to make VBA's shell() synchronous
ASKER CERTIFIED SOLUTION
Avatar of ozphil
ozphil

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial