Link to home
Start Free TrialLog in
Avatar of mrcool4444
mrcool4444

asked on

Windows Startup

How do I make my program open when windows starts up without putting a link in the startup folder in the startup menu?  I think you have to register the program with windows or something like that.  If you do need to register the program, how would I make it register itself automaticaly?
ASKER CERTIFIED SOLUTION
Avatar of Jaysin28
Jaysin28

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mrcool4444
mrcool4444

ASKER

How would I have it do that automaticaly?
In the setup program you would have to include a function to open the Windows INI file and add Myapp.exe to the load= statement in the General section of the ini file.  

You should note however that if your planning for your app to be Windows 2000 logo compliant then you can't make any references to INI files because says that in future versions of Windows these files may not exist.
The only thing is I don't want to use a setup program, and how would I have it open the win.ini file and add it to it?
LoadStr = GetSetting("General","Load","","Win.ini")
LoadStr = Loadstr & "; " & app.EXEName
SaveSetting ("Win.ini", "General", "Load", LoadStr)
Were would I add this to in the code, the General Declorations?  And were it says name, that is were I put the name of my program right?
no, App.exename returns the name of your program.  I would put the declarations in Form_Load.  How did you plan on installing this app?
Going to file and compile and it creates an .exe that works fine with all computers (or atleast the ones I have tried).
There is an error with that code and I don't know what.  Could you please revise it.
It would fine on all the computers that have VBRunxxx.dll where xxx is the version of VB you compiled it with.  Have to be careful doing it that way.

AT anyrate, The only way to do without a setup prog would be to make the entries the first time the program is run.  


Loadstr = GetSetting("Win.ini", "General", "Load","")
Could you start over with the code?
Why not use the registry, doesn't that INI-thingie just seems like 16-bit programming?

In registry add your exe filename in

HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run/

This is a much "cleaner" way of doing it, looks more "professional".

How to add into the registry? Check out www.planet-source-code.com there's probably a couple of codes for that there.