Run your application on Startup programatically
OnStartup('any title does not matter', 'c:\temp\runthis.exe', true);to run your application "runthis.exe" exactly one time.
Procedure OnStartup (const PgmTitle, CmdLine: String; RunOnce: boolean);
Var
Key : String;
Reg : TRegIniFile;
Begin
If RunOnce Then
Key := 'Once' #0
Else
Key := #0;
Reg := TRegIniFile.create ('');
Reg.RootKey := HKEY_LOCAL_MACHINE;
Reg.WriteString ('Software\Microsoft\Windows\CurrentVersion\Run' + Key,
ProgTitle, CmdLine);
Reg.Free
End;
+ نوشته شده در چهاردهم بهمن 1385ساعت توسط حسین |
