use 
BOOL TerminateProcess(    HANDLE hProcess, // handle to the process 
    UINT uExitCode // exit code for the process  
   );
or 
VOID ExitProcess(    UINT uExitCode // exit code for all threads  
   ); 

解决方案 »

  1.   

    可以用tlhelp32单元获取现在系统中的进程,然后在用terminateprocess中杀掉你要的程序就可以了!
      

  2.   

    //==============================================================================
    //强制终止某应用程序运行********************************************************
    //==============================================================================
    procedure AppForceExit(const AppName: string);
    var lppe: TProcessEntry32;
        ssHandle: THandle;
        Wnd: HWND;
        AppFound: Boolean;
    begin
      ssHandle := CreateToolHelp32SnapShot(TH32CS_SNAPALL, 0);
      AppFound := Process32First(sshandle, lppe);
      while AppFound do
      begin
        //其中lppe.szExefile就是程序名**********************************************
        if UpperCase(ExtractFileName(lppe.szExeFile))=UpperCase(AppName) then
        begin
          Wnd := OpenProcess(PROCESS_ALL_ACCESS, true, lppe.th32ProcessID);
          TerminateProcess(Wnd, 0);
        end;
        AppFound := Process32Next(ssHandle, lppe);
      end;
    end;
      

  3.   

    你是要关掉资源管理器呢还是要杀掉explore的进程啊,如果是要杀进程的话那么桌面也会没啦.
      

  4.   

    POSTMESSAGE(FINDWINDOW('CabinetWClass',NIL),wm_close,0,0);