如何以编程方式安装屏幕保护程序? [英] How to install screensaver programmatically?

查看:30
本文介绍了如何以编程方式安装屏幕保护程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以编程方式安装(注册)屏幕保护程序?

How to install (register) screensaver programmatically?

推荐答案

AFAIk 有两种方式:

AFAIk there are two ways:

  1. 通过将其复制到 Windows 搜索的位置(例如 System32)来永久注册.但不要硬编码C:\Windows\System32".需要查询系统才能知道系统目录在哪里.
  2. .scr 文件调用 Install 操作,这会导致临时激活.但是一旦选择了另一个屏幕保护程序并重新启动对话框,屏幕保护程序就会消失.
  1. 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.
  2. 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:

  1. ShellExecute(Ex) 使用 install 动词
  2. 调用rundll32.exe desk.cpl,InstallScreenSaver %l
  3. desk.cpl 加载为库(LoadLibrary 或通过为 InstallScreenSaver 声明导入)然后使用您自己的路径调用 InstallScreenSaver 方法作为参数.
  1. ShellExecute(Ex) using the install verb
  2. Call rundll32.exe desk.cpl,InstallScreenSaver %l
  3. Load desk.cpl as library(LoadLibrary or by declaring an import for InstallScreenSaver) and then call the InstallScreenSaver method with your own path as parameter.

这篇关于如何以编程方式安装屏幕保护程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆