Delphi:如何创建像Skype一样的Windows自动启动应用程序?

发布于 2024-09-08 03:17:42 字数 372 浏览 2 评论 0原文

我想向我的应用程序添加一个类似于 Skype 选项“在计算机启动时运行 Skype”的选项。

Skype 没有进入开始菜单文件夹的“自动启动应用程序”,我希望有同样的效果。

请注意,此问题的一个答案建议添加密钥这里:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

但是我在我的机器上检查了 Skype 不在那里,所以使用了另一种方法。

I'd like to add an option to my application similar to the Skype's option "run Skype as my computer starts".

Skype doesnt't go on the "Auto start applications" of the start menu folder, I'd like to have the same effect.

Note, one answer to this question suggets to add a key here:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

but I checekd on my machine and Skype is not there, so another way is used.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

浮云落日 2024-09-15 03:17:42

Skype 通过注册表项安装,但它位于 HKEY_CURRENT_USER 中,而不是 HKEY_LOCAL_MACHINE

这允许根据每个用户安装或不安装 Skype。使用 HKLM 将为所有用户自动启动。

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

Skype installs via a registry entry, but it's in HKEY_CURRENT_USER , not HKEY_LOCAL_MACHINE

This allows Skype to be installed or not on a per-user basis. Using HKLM will autostart for ALL users.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
呆萌少年 2024-09-15 03:17:42

如果您在运行窗口中键入“msconfig”并查看启动选项卡,您可以在“位置”列中看到“所有内容”的起始位置。
我不使用 Skype,但我猜它会在

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

注册表中您只需为您的应用程序添加一个注册表项(然后将其删除)如果用户取消选中该框)

您可以使用 TRegistry 类来帮助您读取和写入注册表。

If you type "msconfig" into the run window and look at the startup tab you can see where "everthing" starts from in the Location column.
I don't use skype but my guess would it's in the registry in

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

You just need to add a registry entry for your app in there (and delete it if the user unticks the box)

you can use the TRegistry class to help you reading and writing to the registry.

眼眸里的快感 2024-09-15 03:17:42

请参阅此问题。问题是关于C#的,但它只涉及写入注册表值。将其转换为 Delphi 会很容易。

See this question. The question is about C#, but it only involves writing a registry value. It will be easy to convert it for Delphi.

梨涡少年 2024-09-15 03:17:42

只需运行 msconfig 并选择启动选项卡即可。您将在所使用的注册表项旁边看到应用程序。

奇怪的是,当我在没有提升的情况下运行 regedit 时,也看不到值 HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Skype 。但如果我以提升的方式运行它,那么该值就在那里(我猜Windows正在玩注册表重定向)。

最好的

Just run msconfig and select startup tab. You'll see the applications along side the registry key used.

Oddly, when I run regedit without elevation don't see the value HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Skype also. But if I run it elevated then the value is there (I guess that Windows is playing registry redirection).

Best

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文