Archive: How to set a HTML file as desktop wallpaper?


How to set a HTML file as desktop wallpaper?
Just starting out with NSIS tonight.

I have done some searching, and all I have found are posts related to setting a .bmp file as the wallpaper. I would like to know how to set a .html as the wallpaper.

I am trying to make an installer that installs a HTML file to the user's Program Files directory, and set it as the desktop wallpaper. From what I have seen, setting a .bmp as the wallpaper involves using the System plugin to call a function in the user32.dll. After searching on the MSDN site, I found this: http://msdn.microsoft.com/en-us/libr...57(VS.85).aspx

If I'm not wrong (I really don't understand a bit at all of how DLLs in Windows work), IActiveDesktop is an Interface in the shell32.dll file, and the SetWallpaper member will allow setting a .html or .jpg as the desktop wallpaper. Since IActiveDesktop is an *interface* and *not a function* in the shell32.dll, this should mean that the usual way of calling a function in a DLL using the System plugin cannot be used.

There is some code here http://forums.winamp.com/showthread....59#post1386259 mentioning IActiveDesktop, but it looks a bit complicated and I can't understand what the part commented "#create IActiveDesktop interface" is trying to accomplish.

Does anyone know how (after creating the IActiveDesktop interface) to access a member of the interface? (SetWallpaper in this case). Or, better yet, it would be really nice if someone has a working piece of code to set .html or .jpg files as the desktop wallpaper. (and if necessary, refresh the Active Desktop to apply the new wallpaper straightaway)

Many thanks for your patience.


The links in the first post are:
http://msdn.microsoft.com/en-us/library/bb776357(VS.85).aspx
http://forums.winamp.com/showthread....59#post1386259


BTW iactivedesktop not works on Vista :(

if(isVista || !options.fActiveDesktop)
{
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, szBmpFile,
SPIF_UPDATEINIFILE|SPIF_SENDWININICHANGE);
}