prg1.exe = calling program
prg2.exe = program to be called
prg1 code to call prg2:
- Code: Select all
' Specifying vbNormalFocus as the second argument opens the application in
' normal size and gives it the focus.
Dim RetVal
RetVal = Shell("C:\WINDOWS\prg.EXE 0001", vbNormalFocus) ' Run prg2.
prg2 code to unload, back to prg1:
- Code: Select all
'there is some others code before Unload Me
'Function WriteInfoToINIFile()
Unload Me
Requirements:
After prg2 Unload, the prg1 back its previous state and need to change some data depends on the written data from INI File by the prg2 upon the prg1 activate the program.
Problem:
The Activate event of prg1 is not triggered upon activation.
Conclusion:
The Activate event occurs when an object becomes the active window. But moving the focus to or from an object in another application doesn't trigger either event.
Favors to the group:
1) Please give a hints on how to trigger activate event switching between 2 applications.
2) If you have other way to meet the requirements, much better. Please teach me.
3) Also upon calling the prg2, the user should not able access prg1. Its like with calling other form using Show method with vbModal. But it is within the application.. How about between two applications. (maybe Hiding the prg1 first before calling the prg2 then show it again after prg2 unload.
Thank you very much.


