打开屏幕保护程序的 Delphi 代码在 Windows 7 中不起作用

发布于 2024-10-04 16:34:17 字数 214 浏览 0 评论 0原文

我有一个 Delphi 应用程序,它可以使用“这在 XP 下工作正常”将计算机置于屏幕保存状态,

hWnd := GetDesktopWindow ;
SendMessage (hWnd, WM_SYSCOMMAND, SC_SCREENSAVE, 0) ;

但我发现它在(嵌入式)Windows 7 下不起作用。

有什么想法吗?

I have a Delphi app that places the computer into screensave using

hWnd := GetDesktopWindow ;
SendMessage (hWnd, WM_SYSCOMMAND, SC_SCREENSAVE, 0) ;

This works fine under XP but I find it doesn't work under (embedded) Windows 7.

Any ideas?

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

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

发布评论

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

评论(2

柠檬色的秋千 2024-10-11 16:34:17

它适用于我(Windows 7 Home Premium,64 位)。您是否尝试过将消息发送到另一个窗口,例如 Handle? (另外,您确定安装了屏幕保护程序吗?)

It works for me (Windows 7 Home Premium, 64-bit). Have you tried to send the message to another window, such as Handle? (Also, are you sure that you have a screensaver installed?)

请恋爱 2024-10-11 16:34:17

SC_SCREENSAVE 消息告诉目标窗口执行 System.ini 文件的 [boot] 部分中指定的屏幕保护程序应用程序。由于操作系统是嵌入式 Windows,这是 Windows 的精简版本,因此 system.ini 文件很可能被配置为没有屏幕保护程序。检查您的 system.ini 文件。

The SC_SCREENSAVE message tells the target window to execute the screen saver application specified in the [boot] section of the System.ini file. As the o/s is Embedded windows, which is a cut-down version of windows, quiet likely the system.ini file is configured for no screen-saver. Check your system.ini file.

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