Windows API的触发壁纸洗牌 [英] Windows API to trigger wallpaper shuffle
问题描述
有没有办法来触发窗口壁纸幻灯片洗牌? preferably东西,我可以从.NET
Is there a way to trigger a shuffle in windows wallpaper slideshow? Preferably something I can use from .net
编辑:所以我想用IActiveDesktop接口,我从的此处,我试图用这样的:
so I'm trying to use the IActiveDesktop interface, I got it from here, I tried to use it like this:
public static IActiveDesktop GetActiveDesktop()
{
Type typeActiveDesktop = Type.GetTypeFromCLSID(new Guid("{75048700-EF1F-11D0-9888-006097DEACF9}"));
return (IActiveDesktop) Activator.CreateInstance(typeActiveDesktop);
}
,然后调用它是这样的:
and then calling it like this:
IActiveDesktop dt = GetActiveDesktop();
dt.ApplyChanges(AD_APPLY.ALL | AD_APPLY.FORCE | AD_APPLY.BUFFERED_REFRESH);
当我运行code
什么也没有发生,没有任何错误了。
nothing happens when I run the code, no errors too.
推荐答案
请尝试以下操作:
您的主题,位于C:\ Users \用户名\ AppData \本地\微软\的Windows \主题\。主题
Your theme located in C:\Users\USERNAME\AppData\Local\Microsoft\Windows\Themes\.theme
打开。主题文件,并在[幻灯片播放]部分更新洗牌标志:
Open the .theme file and update a Shuffle flag in the [Slideshow] section:
[Slideshow]
Shuffle=1
然后使用IActiveDesktop接口重新加载主题,调用ApplyChange使用以下参数:
Then use IActiveDesktop interface to reload theme, call ApplyChange with the following parameters:
AD_APPLY_ALL | AD_APPLY_FORCE | AD_APPLY_BUFFERED_REFRESH
AD_APPLY_ALL | AD_APPLY_FORCE | AD_APPLY_BUFFERED_REFRESH
这篇关于Windows API的触发壁纸洗牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!