tags:

views:

184

answers:

2

I know there are startup folders and certain registry keys I need to look into. But how to do that using Windows API? I'm interested to know for Windows XP and Vista. Thanks for your time.

+2  A: 

I am not sure such an API exists. Nevertheless you can write a function to do that.

The startup process names and location are stored in following location in registry:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
<Name> <Location of EXE>

You can write small function to open the above registry and read the startup process details.

aJ
There are actually a number of startup registry locations.Run, RunOnce, RunOnceEx, and all those again in HKEY_LOCAL_MACHINE.
DeadHead
+3  A: 

There is no single API to get all the programs that run while the system is starting up. Consider all the things that Autoruns shows. Updates to that program occasionally allow it to show new classes of programs, and since those are updates to the program and not to the OS, it's obviously not some API that's changing to include more things. Rather, it's the program that's gradually expanding its notion of what an "auto-run program" is.

Work out what you wish to consider to be a "startup process," and then you can determine what APIs or other techniques you can combine to find out what all those processes are.

Among the places to look include the following:

Each bullet point includes at least one link to a page on MSDN that should get you started. If you need more, consider asking some more specific questions.

Rob Kennedy
This is the list I was expecting as an answer. Thanks.
Donotalo