Vb, Delphi, .net, framework, C++, Java, Pascal,Visual Studio, Asm, Ruby, C#, j#, Cs, Html, Php, Perl, Asp, xHtml Get Free Souce Code Here...



Making an application run automatically when Windows starts

One way is placing a direct access to the application in the Startup folder of Windows Start Menu. Alternatively, you can add a value under the appropriate key in the Windows Registry, as shown below:

  procedure TForm1.Button1Click(Sender: TObject);
  begin
    SetRegistryData(HKEY_LOCAL_MACHINE,
      'Software\Microsoft\Windows\CurrentVersion\Run',
      Application.Title, rdString, Application.ExeName);
  end;

NOTE: SetRegistryData has been featured in the article "Accessing the       Windows Registry": http://www.delphi3000.com/articles/article_1575.asp

Instead of Application.Title you can write a string with a unique name for the application, and instead of Application.ExeName you can write the full path name of the application (as well as its command-line parameters if they are needed)

0 comments:

Post a Comment