restart the own program?

Author: Paul Ericksen 

0 Comments to this tip [Write new comment]

[ Print tip ]    

 

Tip Rating (24):  

Skill:  

Useful:  

Overall:  

 

 

 

procedure TForm1.Button1Click(Sender: TObject);

var

  FullProgPath: PChar;

begin

  FullProgPath := PChar(Application.ExeName);

  // ShowWindow(Form1.handle,SW_HIDE);

  WinExec(FullProgPath, SW_SHOW); // Or better use the CreateProcess function

  Application.Terminate; // or: Close;

end;