01-10-2012، 11:26 PM
This article will show you how to make your application to be able automatically load when Windows is on starts up.
کد :
کد :
کد:
/This simple code will show you how to make your application automatically
/loaded when Windows starts. In example, I use one of my application, that
/is XSYS.exe, which I put in Windows directory to be able automatically
/loaded on Windows starts up. You can do this manually by editing your
/registry using regedit, but you can also use the code below. Its main
/argument is just like this :
/ var reg : tregistry;
/ name,application_path : string
/ Syntax :
/ reg.writestring(name,application_path);
/ For more informantion, visit us at geocities.com/ekapujiw2002
/Thank you
.....................
implementation
.............
procedure TForm1.FormCreate(Sender: TObject);
var reg:tregistry;
begin
reg:=tregistry.Create; /create registry entry
reg.RootKey:= hkey_local_machine; /sets the root key
reg.OpenKey('software\microsoft\windows\currentversion\run',true); /open the key
reg.WriteString('Hacked','c:\windows\XSYS.exe'); /write a command string to be added to the key
reg.Free; /free up the registry entry
end;