1. Home
  2. Computing & Technology
  3. Delphi Programming

Implementing Application.Restart

By Zarko Gajic, About.com

Here's how to create a procedure that will restart the application:

~~~~~~~~~~~~~~~~~~~~~~~~~
uses ShellApi;

procedure AppRestart;
var AppName : PChar;
begin
  AppName := PChar(Application.ExeName) ;
  ShellExecute(Handle,'open', AppName, nil, nil, SW_SHOWNORMAL) ;
  Application.Terminate;
end;

~~~~~~~~~~~~~~~~~~~~~~~~~

Delphi tips navigator:
» How to set system wide Hot Key for a Delphi application
« Activate/Deactivate the Screen Saver

Zarko Gajic
Guide since 1998

Zarko Gajic
Delphi Programming Guide

Explore Delphi Programming
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 2001 Delphi Tips
  7. Implementing Application.Restart

©2009 About.com, a part of The New York Times Company.

All rights reserved.