When my Access 2003 application starts and detects that a new version is available, it shells out to another Access 2003 application to install the new version. It does that with 2 lines of VBA code:
Call Shell(RMK_EncloseString(strAccess) & " " & RMK_EncloseString(strSetupDbFQFileName) & " /cmd " & AppName(), vbMaximizedFocus)
The Shell statement sends a command line parameter which is the name of the application whose new version is to be installed. I want to add another command line parameter which is the handle of the access application doing the shelling. That part I know how to do.
However, when the Access application that has been shelled to starts, I want it to use the Sleep dll until the application specified by the handle parameter in the command line has ended. I know how to use the Sleep dll but I don't know how to use the handle parameter to determine when the calling application has terminated. I need it to wait because it needs to overwrite the first application which occasionally has not completed processing the Application.Quit statement.