<p>I've read in a couple of places that the desktop wallpaper can be set to an HTML document. Has anyone had any success changing it programmatically? </p>

<p>The following snippet of VB6 helps me set things up for BMPs but when I try to use it for HTML, I get a nice blue background and nothing else.</p>

<pre><code>Dim reg As New StdRegistry

Public Function CurrentWallpaper() As String
    CurrentWallpaper = reg.ValueEx(HKEY_CURRENT_USER, "Control Panel\Desktop", "Wallpaper", REG_SZ, "")
End Function

Public Sub SetWallpaper(cFilename As Variant)
    reg.ClassKey = HKEY_CURRENT_USER
    reg.SectionKey = "Control Panel\Desktop"
    reg.ValueKey = "Wallpaper"
    reg.ValueType = REG_SZ
    reg.Default = ""
    reg.Value = cFilename
End Sub

Public Sub RefreshDesktop()
    Dim oShell As Object
    Set oShell = CreateObject("WScript.Shell")
    oShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
End Sub
</code></pre>

<p>Perhaps there's some other setting that's required. Any ideas?</p>

[{'answer_id': 80334, 'author': 'Blorgbeard', 'author_id': 369, 'author_profile': 'https://Stackoverflow.com/users/369', 'pm_score': 2, 'selected': False, 'text': '<p>I think you need to make sure "Active Desktop" is turned on.</p>\n\n<p>You might try setting <code>HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\ForceActiveDesktopOn</code> to <code>1</code> (found <a href="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/93205.mspx?mfr=true" rel="nofollow noreferrer">here</a>).</p>\n\n<p>I haven\'t tried it, so no guarantees.</p>\n'}, {'answer_id': 83921, 'author': 'bugmagnet', 'author_id': 426, 'author_profile': 'https://Stackoverflow.com/users/426', 'pm_score': 0, 'selected': False, 'text': '<p>Getting closer: <a href="http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/w2rkbook/gp.mspx?mfr=true" rel="nofollow noreferrer">http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/w2rkbook/gp.mspx?mfr=true</a>\n<hr />\nBut it turns out that I was getting sidetracked in Policy space. What I really wanted was to set the desktop in the userspace and let the Policy settings stand. Some helpful stuff was found here: <a href="http://blogs.msdn.com/coding4fun/archive/2006/10/31/912569.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/coding4fun/archive/2006/10/31/912569.aspx</a>. </p>\n\n<p>This isn\'t the final solution, however. The control of HTML desktops is still out of reach.\n<hr />\nSeems that HTML settings are stored in HKCU\\Software\\Microsoft\\Internet Explorer\\Desktop\\General. However, just storing them here doesn\'t seem to be enough. I still need to find the mechanism that lets Windows know which set of registry values to use.</p>\n'}, {'answer_id': 84359, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>I recomend only BMP format. Do not use ActiveDesctop, because you PC will work slowly after that.</p>\n'}, {'answer_id': 84489, 'author': 'Matt', 'author_id': 2338, 'author_profile': 'https://Stackoverflow.com/users/2338', 'pm_score': 2, 'selected': True, 'text': '<p>I\'m not sure if there\'s an official API for this, but if you have your heart set on it you could use Sysinternal\'s <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx" rel="nofollow noreferrer">Process Monitor</a> and see what registry keys get touched when you set an HTML desktop background via the UI.  Then you\'d just need to repeat those edits in your code.  However, an API call would be far preferable in terms of backward/forward compatibility.</p>\n'}, {'answer_id': 89333, 'author': 'bugmagnet', 'author_id': 426, 'author_profile': 'https://Stackoverflow.com/users/426', 'pm_score': 2, 'selected': False, 'text': '<p>Okay, I\'ve discovered the answer to my question, thanks to egl1044 on <a href="http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_23739345.html" rel="nofollow noreferrer">Experts Exchange</a>. Essentially, one must talk to the IActiveDesktop object. A good implementation of that, in VB6, can be found at <a href="http://www.vbforums.com/showthread.php?t=367342" rel="nofollow noreferrer">VB6 - JPEGs as wallpapers (without conversion)</a>.</p>\n'}]
['https://Stackoverflow.com/questions/80307', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/426/']