Windows API的触发壁纸洗牌壁纸、Windows、API

由网友(独惯了)分享简介:有没有办法来触发窗​​口壁纸幻灯片洗牌?preferably东西,我可以从.NET Is there a way to trigger a shuffle in windows wallpaper slideshow?Preferably something I can use from .net编辑:所以我想...

有没有办法来触发窗​​口壁纸幻灯片洗牌? 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:UsersUSERNAMEAppDataLocalMicrosoftWindowsThemes.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

阅读全文

相关推荐

最新文章