Solved

OpenProcess()

Posted on 1997-11-10
1
1,227 Views
Last Modified: 2008-09-30
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
0
Comment
Question by:msaccess
1 Comment
 
LVL 4

Accepted Solution

by:
ozphil earned 100 total points
ID: 1959204
OpenProcess() is not a VB library routine.

To adapt it to your needs i need you to paste the entire code here. Ill then modify it for you.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now