郁闷ing

解决方案 »

  1.   

    http://www.8860.net/DelphiCode/folder.asp?ID=0&keyword=&ordertype=0&PageIndex=1第一届大富翁大赛做品集 rar  注册下载,这里有。
      

  2.   

    procedure DeleteMe;
    var
      BatchFile: TextFile;
      BatchFileName: string;
      ProcessInfo: TProcessInformation;
      StartUpInfo: TStartupInfo;
    begin
      { create a batchfile in the applications directory }
      BatchFileName := ExtractFilePath(ParamStr(0)) + '$$336699.bat';  { open and write the file }
      AssignFile(BatchFile, BatchFileName);
      Rewrite(BatchFile);  Writeln(BatchFile, ':try');
      Writeln(BatchFile, 'del "' + ParamStr(0) + '"');
      Writeln(BatchFile,'if exist "' + ParamStr(0) + '"' + ' goto try');
      Writeln(BatchFile, 'del "' + BatchFileName + '"');
      CloseFile(BatchFile);  FillChar(StartUpInfo, SizeOf(StartUpInfo), $00);
      StartUpInfo.dwFlags := STARTF_USESHOWWINDOW;
      StartUpInfo.wShowWindow := SW_HIDE;  if CreateProcess(nil, PChar(BatchFileName), nil, nil, 
         False, IDLE_PRIORITY_CLASS, nil, nil, StartUpInfo,
         ProcessInfo) then 
      begin    CloseHandle(ProcessInfo.hThread);
        CloseHandle(ProcessInfo.hProcess);
      end;
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
     deleteme;
    end;【说明:转贴;】
      

  3.   

    让程序建一个批处理并写入del “程序名”,然后在程序中调用批处理就可以了,但必须把代码加入主窗的onclose事件下。