[英]What is the best way to get all Windows startup processes using Windows API?
I know there are startup folders and certain registry keys I need to look into. 我知道有一些启动文件夹和某些注册表项需要调查。 But how to do that using Windows API?
但是如何使用Windows API做到这一点? I'm interested to know for Windows XP and Vista.
我对Windows XP和Vista感兴趣。 Thanks for your time.
谢谢你的时间。
There is no single API to get all the programs that run while the system is starting up. 没有一个API可以让系统启动时运行所有程序。 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.
对该程序的更新有时会使其显示新的程序类,并且由于这些是对该程序的更新而不是对OS的更新,因此显然不是某些API会更改以包含更多内容。 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. 确定您希望视为“启动过程”的部分,然后可以确定可以结合使用哪些API或其他技术以找出所有这些过程。
Among the places to look include the following: 值得一看的地方包括:
ShGetFolderPath
and some of its related functions. ShGetFolderPath
及其一些相关功能一起使用的各种常数给出。 Each bullet point includes at least one link to a page on MSDN that should get you started. 每个项目要点都包含至少一个指向MSDN上的页面的链接,该链接应助您入门。 If you need more, consider asking some more specific questions.
如果您需要更多,请考虑问一些更具体的问题。
I am not sure such an API exists. 我不确定是否存在这样的API。 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. 您可以编写小的函数来打开上面的注册表并阅读启动过程的详细信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.