IDesktopWallpaper::Enable method (shobjidl_core.h)
Enables or disables the desktop background.
Syntax
HRESULT Enable(
[in] BOOL enable
);
Parameters
[in] enable
TRUE to enable the desktop background, FALSE to disable it.
Return value
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code, including the following.
Return code | Description |
---|---|
|
The desktop wallpaper is already in the state you're asking for through this call. |
|
The desktop wallpaper that would be used when the background is enabled is missing from its expected location. Call SetWallpaper to specify a new wallpaper. |
Remarks
This method would normally be called to disable the desktop background for performance reasons.
When the desktop background is disabled, a solid color is shown in its place. To get or set the specific color, use the GetBackgroundColor and SetBackgroundColor methods.
Note A call to the IDesktopWallpaper_SetWallpaper or IDesktopWallpaper_SetSlideshow methods will enable the desktop background even if it is currently disabled through this method.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 8 [desktop apps only] |
Minimum supported server | Windows Server 2012 [desktop apps only] |
Target Platform | Windows |
Header | shobjidl_core.h (include Shobjidl.h) |