Solved

Adding a program to Startup

Posted on 1998-06-12
5
278 Views
Last Modified: 2010-08-05
I would like to add a program to the Startup Menu.
Is there an API in Windows which does that.
Can this API be used in WIN95, 98, NT Server and WorkStation.
Is it possible to have this program be the first one in the list of Startup.
Can all the programs in Startup be delayed until this program is completed.

I would appreciate some sample code if possible.

Thanks
0
Comment
Question by:rian
5 Comments
 
LVL 1

Accepted Solution

by:
sfranks earned 100 total points
ID: 1165733
Yes there is an API it is called "copyFileA" located in kernel32

What you would do is copy a shortcut of the program that you want in the startup menu to
the c:\windows\start menu\startup directory in WIN95, in nt you would add it to the
c:\winnt\profiles\"current user"\startup or else the profiles\all users\ or profiles\default user\ directories this would then make the icon appear in the startup menu and be executed upon startup.

As far as it being the first one in the startup menu you would have to give it the highest order name like 1program-name.  

I don't think it is possible to delay the other programs though....  


0
 
LVL 11

Expert Comment

by:alexo
ID: 1165734
Call SHGetSpecialFolderLocation() with the CSIDL_STARTUP argument to get the startup folder location.
0
 

Expert Comment

by:ms99y
ID: 1165735
If you want your program to begin at the start up Also you can write the program name in the registry. If you make a new key into the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" and  register your program name here, Whenever the user log in or restart the PC.Your program automatically executes.

Later
0
 

Author Comment

by:rian
ID: 1165736
Is there an API in C++ to do that
0
 

Expert Comment

by:ms99y
ID: 1165737
To make entry to the registry , you can use the regxxxx  functions in the API. These are RegOpenKey, RegSaveKey, RegCloseKey and so on, once you make the registry entry  your program program will execute without need to write to startup. You can get detailed information and the other functions related from the Win API help

Later
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

757 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

22 Experts available now in Live!

Get 1:1 Help Now