IActiveDesktop wallpaper fade effect not working after restart

…衆ロ難τιáo~ 提交于 2019-12-06 11:26:03

问题


Am I missing something using IActiveDesktop?

Sympthoms: After system (Win7/Win8) restart fade effect during wallpaper change disappears.

To restore it I have to manually go to "Personalization->Desktop Backgrounds" and set "Picture Location" from "My Pictures"(?) back to "Windows Desktop Backgrounds" and then back(!). After this action fade effect is working fine again until the next system restart.

I don't understand what reverts it back and how to stop it. How to set "Windows Desktop Background" option programmatically? What system does in background?

Code itself is pretty standard and taken from MSDN/CodeProject.


回答1:


You have to tell windows that you want to enable ActiveDesktop. I tell it every time right before setting the wallpaper through ActiveDesktop.

public static void EnableActiveDesktop()
{
    IntPtr result = IntPtr.Zero;
    WinAPI.SendMessageTimeout(WinAPI.FindWindow("Progman", null), 0x52c, IntPtr.Zero, IntPtr.Zero, 0, 500, out result);
}

You can see this in context here: https://pulse.codeplex.com/SourceControl/changeset/view/72677#1589017



来源:https://stackoverflow.com/questions/14773287/iactivedesktop-wallpaper-fade-effect-not-working-after-restart

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!