Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am a VC++ developer. and I want to know that how can I start my
MFC dialog based application at the time of windows starting. I want to programmatically set this settings as default.Please give some sample code about it.

Thanks
Sibi V J
Posted
Updated 5-Jan-11 1:48am
v3

Or you can create a registry entry for this

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Type REG_SZ

Name: your app name
Data: Path to your application
 
Share this answer
 
Comments
Rajesh Anuhya 5-Jan-11 6:41am    
Good answer +5
#realJSOP 5-Jan-11 7:58am    
And all of the standard warnings about manually setting registry entries should be heeded.
fjdiewornncalwe 6-Jan-11 14:37pm    
Best way to do it programmatically. +5
You just copy your application to Windows Startup folder through code.
 
Share this answer
 
There are several placed to register this thing -- Startup Folder is the easiest but the worst (least universal).

First, consider to create and install Windows Service. This can be a big overkill, I know.

For regular applications, I can offer an ultimate advice: go to Sysinternals Suite:

http://technet.microsoft.com/en-us/sysinternals/bb842062[^].

Download all -- many very good utilities, but you will need to run Autoruns. Look how it works and read the help: it will give you the ultimate description of all locations (practically, all in registry) where to register your application to start automatically.

It works!

That's it.
 
Share this answer
 
v4
Comments
fjdiewornncalwe 6-Jan-11 14:38pm    
In depth and accurate (as usual...) +5
It's not a coding thing.Just drag the app into your startup folder, and it will start when the user logs in.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900