Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MFC (http://www.go4expert.com/forums/mfc/)
-   -   Close Exe File Using Visual C++ (http://www.go4expert.com/forums/close-exe-file-using-visual-cpp-t8279/)

masanka 16Jan2008 11:40

Close Exe File Using Visual C++
 
Hi All
Please tell me how to close an EXE Using visual C++.This EXE is an separate EXE file

EX.
ABC.exe and XYZ.EXE
I am Runing XYZ.exe Using ABC.EXE (In ABC.EXE Shell command) I want close this XYZ.EXE
using ABC.EXE in VC++

Please help me

Thanks
masanka

shabbir 16Jan2008 17:23

Re: Close Exe File Using Visual C++
 
Use the FindWindow to get the handle to the EXE running and send the WM_CLOSE / WM_QUIT message and it should close the running exe.

masanka 16Jan2008 17:52

Re: Close Exe File Using Visual C++
 
Quote:

Originally Posted by shabbir
Use the FindWindow to get the handle to the EXE running and send the WM_CLOSE / WM_QUIT message and it should close the running exe.


Hi
Please Tell me how can do this I am beginer for the VC++ and i want close Word document file In Same time (abc.doc) Simply word exe file

Thanks
masanka

shabbir 16Jan2008 19:14

Re: Close Exe File Using Visual C++
 
Code:

HWND hWnd = ::FindWindow(NULL,"abc.exe");
::SendMessage(hWnd,WM_CLOSE,0,0);

Here is the sample pseudo

masanka 17Jan2008 08:40

Re: Close Exe File Using Visual C++
 
Tahnk You Very Much For ur Reply

masanka


All times are GMT +5.5. The time now is 09:27.