Which API can set a image file as wallpaper?
-
I do have MSDN.But I don't know which keyword I can use to look for it!
-
I do have MSDN.But I don't know which keyword I can use to look for it!
SystemParametersInfo()
with theSPI_SETDESK_WALLPAPER
option. However, this is a temporary change (it disappears after a reboot). To make it permanent, you'll also have to change the registry. The key to look at is "HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper". Remember that this only works if web-view is disabled for the desktop, and Windows can only show BMP images when web-view is disabled. Hope this helps Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact" -
I do have MSDN.But I don't know which keyword I can use to look for it!
-
I do have MSDN.But I don't know which keyword I can use to look for it!
[MSDN October 2001] IActiveDesktop::SetWallpaper Sets the wallpaper for the Active Desktop. HRESULT SetWallpaper( LPCWSTR pwszWallpaper, DWORD dwReserved ); Parameters pwszWallpaper String value containing the file name of the wallpaper to be set. dwReserved Reserved. Must be set to zero. Return Values Returns S_OK if successful, or an OLE error code otherwise. See Also IActiveDesktop Requirements Version 4.71 and later of Shell32.dll Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with Internet Explorer 4.0 or later). Windows 95/98/Me: Requires Windows 98 (or Windows 95 with Internet Explorer 4.0 or later). Header: Declared in Shlobj.h. So it should work from IE 4.0+. Hope it helps. For a lower version, try SystemParametersInfo: BOOL SystemParametersInfo( UINT uiAction, // system parameter to retrieve or set UINT uiParam, // depends on action to be taken PVOID pvParam, // depends on action to be taken UINT fWinIni // user profile update option ); SPI_SETDESKWALLPAPER Sets the desktop wallpaper. The value of the pvParam parameter determines the new wallpaper. To specify a wallpaper bitmap, set pvParam to point to a null-terminated string containing the name of a bitmap file. Setting pvParam to "" removes the wallpaper. Setting pvParam to SETWALLPAPER_DEFAULT or NULL reverts to the default wallpaper.