Close Exe File Using Visual C++

masanka's Avatar, Join Date: Dec 2007
Light Poster
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
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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.
0
masanka's Avatar, Join Date: Dec 2007
Light Poster
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
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Code:
HWND hWnd = ::FindWindow(NULL,"abc.exe");
::SendMessage(hWnd,WM_CLOSE,0,0);
Here is the sample pseudo
0
masanka's Avatar, Join Date: Dec 2007
Light Poster
Tahnk You Very Much For ur Reply

masanka