[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Automatic run

Posted on 1997-04-30
1
Medium Priority
?
156 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
slp earned 200 total points
ID: 1335796
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

656 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