如题!真心求教!

解决方案 »

  1.   

    可以啊~~~在线程中调用terminateprocess(getcurrentprocess,0)
      

  2.   

    在你的程序退出的时候写一个批处理如下,
    del xxx.exe//这里是你的exe文件
    del %0//这里是删除自己
    ,然后winexe执行这个bat文件,就可以了
      

  3.   

    给你全部代码,给分吧!~!
    procedure TForm1.colsequery(Sender: TObject);
    var Selfname,BatFilename,s1,s2:string;
    BatchFile: TextFile;
    begin
    Selfname:=Extractfilename(application.exename);//取EXE文件自己的名称
    BatFilename:=ExtractFilePath(Application.ExeName)+ 'a.bat';//批处理文件名称
    S1:='@del '+Selfname;
    S2:='if exist '+Selfname+' goto pp';
    assignfile(BatchFile,BatFilename);
    rewrite(BatchFile);
    writeln(BatchFile,':pp');
    writeln(BatchFile,S1);
    writeln(BatchFile,S2);
    writeln(BatchFile,'@del %0');
    closefile(BatchFile);
    winexec(pchar(BatFilename),sw_hide);//隐藏窗口运行a.bat
    application.Terminate;//退出程序
    end;