本文介绍了如何以编程方式安装屏幕保护程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何以编程方式安装(注册)屏幕保护程序?
How to install (register) screensaver programmatically?
推荐答案
AFAIk 有两种方式:
AFAIk there are two ways:
- 通过将其复制到 Windows 搜索的位置(例如
System32
)来永久注册.但不要硬编码C:\Windows\System32".需要查询系统才能知道系统目录在哪里. - 对
.scr
文件调用Install
操作,这会导致临时激活.但是一旦选择了另一个屏幕保护程序并重新启动对话框,屏幕保护程序就会消失.
- Permanent registration by copying it to a location that windows searches, such as
System32
. But don't hardcode "C:\Windows\System32". You need to query the system to find out where the system directory is. - Calling the
Install
action on the.scr
file, which results in temporary activation. But the screensaver will disappear once another has been selected and the dialog restarted.
但这是Win95时代的,所以可能已经过时了.
But this is from Win95 times, so it's possibly outdated.
我看到了三种调用 install
的方法:
I see three ways to call install
:
- ShellExecute(Ex) 使用
install
动词 - 调用
rundll32.exe desk.cpl,InstallScreenSaver %l
- 将
desk.cpl
加载为库(LoadLibrary 或通过为InstallScreenSaver
声明导入)然后使用您自己的路径调用InstallScreenSaver
方法作为参数.
- ShellExecute(Ex) using the
install
verb - Call
rundll32.exe desk.cpl,InstallScreenSaver %l
- Load
desk.cpl
as library(LoadLibrary or by declaring an import forInstallScreenSaver
) and then call theInstallScreenSaver
method with your own path as parameter.
这篇关于如何以编程方式安装屏幕保护程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!