HANDLE hProcessHandle;
ULONG nProcessID;
HWND TheWindow;
TheWindow = ::FindWindow( NULL, "你的exe的名称" );
::GetWindowThreadProcessId( TheWindow, &nProcessID );
hProcessHandle =::OpenProcess( PROCESS_TERMINATE,FALSE, nProcessID );
::TerminateProcess( hProcessHandle, 4 );