How to call B.exe from A.exe and then stop A.exe 
Author Message
 How to call B.exe from A.exe and then stop A.exe

Hi!

I want to write a program (say, A.exe)  that can run another program (say,
B.exe).
In VC, I know I can use "system" function to execute B.exe from A.exe.
But I want to stop A.exe after B.exe starts to run, I do not how to do this.
Is there anyone can give me an idea?
Thank you!!

Dennis



Mon, 15 Nov 2004 14:42:05 GMT  
 How to call B.exe from A.exe and then stop A.exe
ShellExecute( AfxGetMainWnd()->GetSafeHwnd(), "open",
   "abc.exe", 0, 0, SW_SHOWNORMAL);
 PostMessage(WM_CLOSE, 0, 0);


Quote:
> Hi!

> I want to write a program (say, A.exe)  that can run another program (say,
> B.exe).
> In VC, I know I can use "system" function to execute B.exe from A.exe.
> But I want to stop A.exe after B.exe starts to run, I do not how to do this.
> Is there anyone can give me an idea?
> Thank you!!

> Dennis



Mon, 15 Nov 2004 14:59:19 GMT  
 How to call B.exe from A.exe and then stop A.exe

Quote:
> Hi!

> I want to write a program (say, A.exe)  that can run another program (say,
> B.exe).
> In VC, I know I can use "system" function to execute B.exe from A.exe.
> But I want to stop A.exe after B.exe starts to run, I do not how to do
this.
> Is there anyone can give me an idea?

Sure, from within A, you use exec() c function or other win32 API to start
B.  Then in A, keep checking if B process running.  If yes, exit itself.  Or
better from B, send a Windows message to signal A to terminate itself.

Actually, since A starts B while A still running, why not just start B and A
quit itself?  Isn't that what you asked for or I mis-read something?



Mon, 15 Nov 2004 15:12:26 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. a.exe + b.exe = c.exe

2. redistributing cl.exe, link.exe, nmake.exe, etc.

3. cl.exe, link.exe, mscvrt.exe Madness...

4. debug exe OK but release exe crashes

5. Custom Event From a EXE to another EXE

6. SOAPSUDS.exe and WSDL.exe

7. Help: start win .exe from win .exe

8. ATL Exe Vs MFC Exe

9. CRecordset AND Debug exe success AND Release exe failure

10. Debug a exe launched by another exe

11. Debug VC6 exe launched from VB6 exe

12. using FAULT address of EXE sans .pdb in EXE with .pdb

 

 
Powered by phpBB® Forum Software