Saturday, 3 January 2015
Home » » Automatic restart delphi application
Automatic restart delphi application
To Share | Saturday, 3 January 2015
OK, a few tips just for today. There are times in making our application must restart the application itself, without restarting Windows. especially if it is a database application. eg, there is a database application. after performing a database restore, then re-connection is required between applications with the database. to avoid errors that are not expected and unexpected, it is necessary to restart the application. and of course, it would be more cool and fun if he could restart itself. If you find a case like this, then the code that is needed is:
ShellExecute (Handle, 'open', PAnsiChar (ParamStr (0)), ",", SW_SHOW); Application.Terminate; / / or can use "Close" wrote
o yes, sometimes restart occurs more rapidly than the process of importing the database. so, if you find errors in the form of tables that have not exist, then the lag time required restart. eg, "restore the database successfully, the application will restart in 5 seconds." and after 5 seconds, then restart the application. for something like this, of course you can add a timer component.
Thus a few tips. may be useful