jocas
asked on
loading a program at startup
I'm using Delphi 1.0, and I'd like programmatically add a program to Program Manager's (or the Start Menu's) Startup group. Is there an easy way to do this?
Sorry,
Wrong Answer.
Wrong Answer.
not easy, but yes, there is a way :)
You can write into win.ini file :
[windows]
run = Previous.EXE(s) YourProgram.EXE
This way both Previous.EXE (can be more than one) and your EXE file will be loaded automatically by Win 3.11 and Win 9x (i'm not sure about NT).
To write into win.ini use TIniFile.
Do not forget to preserve previous settings (by first reading them using IniFile.ReadString.
[windows]
run = Previous.EXE(s) YourProgram.EXE
This way both Previous.EXE (can be more than one) and your EXE file will be loaded automatically by Win 3.11 and Win 9x (i'm not sure about NT).
To write into win.ini use TIniFile.
Do not forget to preserve previous settings (by first reading them using IniFile.ReadString.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Look for the STARTUP.GRP file in the Windows directory (possibly Windows\system? I can't remember which). I believe the GRP file has the same layout as an INI file. If so you can add a line in it that will start your program.
oops sorry Barry I didn't see your post
with TRegIniFile.Create('') do
begin
RootKey:=HKEY_LOCAL_MACHIN
WriteString('Software\Micr
Free;
end;