如何在 Windows 7 中开始幻灯片桌面更改
我正在尝试触发桌面幻灯片更改,但我找不到公共 API 来执行此操作...
我更接近的是看到正在使用的方法的名称(它们正在使用 COM 对象,但我不知道实例化它的 CLSID)。
我已经知道如何更改桌面壁纸(我已经在这样做了),我想要的是一种触发幻灯片转换的方法(Windows 7 的新功能)。
I'm trying to trigger a desktop slideshow change but I can't find a public API to do it...
The closer I got was to see the name of the methods that are using (they are using a COM object, but I don't know the CLSID to instantiate it).
I already know how to change the desktop wallpaper (i'm doing that already), what I want is a way to trigger the slideshow transition (new to Windows 7).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这并没有回答你的问题,你可能已经解决了,但是如果桌面幻灯片引擎(我将这样称呼它)已经启动(如果你调出“个性化”>“桌面背景”,然后选择从“图片位置”下拉列表中选择“Windows 桌面背景”,然后您将看到背景淡入和淡出 - 这就是引擎打开的情况)然后您可以使用 IActiveDesktop 界面,方法是使用您的 JPEG 图片调用“SetWallpaper”,然后使用以下参数调用“ApplyChanges”:
<代码>AD_APPLY_ALL | AD_APPLY_FORCE | AD_APPLY_BUFFERED_REFRESH
当您这样做时,您会注意到幻灯片过渡效果用于显示您指定的壁纸。 迷人的。
但是重新启动(或终止 Explorer.exe 并重新启动它)并且相同的调用不会执行转换,它只会以旧的即时方式更改背景。 使用 Spy++ 进行的一些挖掘表明,当幻灯片引擎运行时,实际的桌面FolderView不再位于窗口父/子关系中的“程序管理器”下,它由一个名为“WorkerW”的新窗口拥有,该窗口位于资源管理器中(与与上面的调用堆栈很好地配合)。 换句话说,它从 Progman 手中控制了桌面窗口。
因此,您需要做的是弄清楚如何让资源管理器初始化桌面窗口的新所有者(“幻灯片引擎”),然后您可以使用 IActiveDesktop 界面来更改背景。
This doesn't answer your question, and you may have worked it out already, but if the desktop slideshow engine (as I'll call it) has been started (if you bring up 'Personalize' > 'Desktop Background' then choose 'Windows Desktop Backgrounds' from the 'Picture location' drop down, then you'll see the background fade in and out - that's the engine on) then you can use the IActiveDesktop interface by calling 'SetWallpaper' with your JPEG picture and then 'ApplyChanges' with the following parameters:
AD_APPLY_ALL | AD_APPLY_FORCE | AD_APPLY_BUFFERED_REFRESH
When you do you'll notice the slideshow transition effect is used to show the wallpaper you've specified. Lovely.
Reboot however (or kill off Explorer.exe and re-start it) and the same call won't do the transition, it'll just change the background in the old, instant way. Some digging with Spy++ shows that when the slideshow engine is running, the actual desktop FolderView no longer lives under 'Program Manager' in the window parent / child relationship, it's owned by a new window called 'WorkerW' which lives inside Explorer (ties up nicely with your call stack above). In other words, it's taking control of the desktop window from Progman.
So what you need to do is figure out how to get Explorer to initialise that new owner of the desktop window (the 'slideshow engine') and then you can use the IActiveDesktop interface to change the background.