Solved

Automatic run

Posted on 1997-04-30
1
128 Views
Last Modified: 2010-04-04
How can I make my app to run averytime the Windows start. How can I put its icon in the program manager group StartUp, when it is called differently in every language mutation of MS-Windows? Or is there any possibility to add more than one RUN= command into WIN.INI? How?   Thanx, Bocian
0
Comment
Question by:Bocian
1 Comment
 
LVL 1

Accepted Solution

by:
slp earned 100 total points
Comment Utility
Windows will ignore all but the last RUN= line it encounters in WIN.INI, but more than one program can be started from the RUN= line, they just have to be separated by spaces.  So, you could read in the current line, append your program's name to the line, then write it back out.  Something like :

uses
  IniFiles ;
var
  WININI : TIniFile ;
  S : string ;
begin
  WININI := TIniFile.Create( 'WIN.INI' ) ;
  S := WININI.ReadString( 'WINDOWS', 'RUN', '' ) ;
  S := S + ' MYPROG.EXE' ;
  //        ^ be sure to include a space to separate your
  //       program's name
  WININI.WriteString( 'WINDOWS', 'RUN', S )
  WININI.Free ;
end ;

One error here you may want to trap for here is that .INI file lines cannot be longer than 127 characters (including the label and = sign).

With regard to putting your program into the StartUp group, by default it's called "StartUp" in both Windows3.1x and 95, though there's a PROGMAN.INI setting in Win3.1 that lets you change the name of the startup group (something similar is available in Win95 using the system policy editor).  You should be able to do this pretty reliably with a DDE conversation with the "shell" (Program Manager in 3.1 or the Explorer in 95), I can get some details on that if that's the route you want to go.

HTH

slp

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now