(The function of API can set BMP as wallpaper. The method is as follows: systemparametersinfo (SPI _ setdeskwallpaper, 0,
_T("c:\\windows\\clouds.bmp "),
SPIF _ sendwinichange | SPIF _ UPDATEINIFILE); -
(2) The 2)JPG picture is set as wallpaper as follows: The function parameters have the following meanings:
StrPicPath is the path of JPG pictures.
The flags are the following values:
WPSTYLE_CENTER
WPSTYLE_TILE
WPSTYLE_STRETCH
WPSTYLE_MAX
Include the following header files:
# contains "wininet.h"
- .
/*
Boolchange wallpaper (char * strpicpath, DWORD logo)
{
WCHAR tempstr[MAX _ PATH];
MultiByteToWideChar(CP_ACP,0,strPicPath,- 1,tempstr,sizeof(tempstr)); HRESULT hr
IActiveDesktop * pActiveDesktop co-initialization (null);
HR = cocreate instance(CLSID _ ActiveDesktop,NULL,CLSCTX_INPROC_SERVER,IID_IActiveDesktop,(void * *)& amp; pactive desktop);
if(hr == S_OK)
{
pactive desktop-& gt; SetWallpaper(tempstr,0); Wallpaper wpo
WPO . dwsize = sizeof(wallpaper opt);
wpo.dwStyle = flags
pactive desktop-& gt; set wallpaper options(& amp; wpo,0);
pactive desktop-& gt; APPLY changes(AD _ APPLY _ ALL);
pactive desktop-& gt; Publish (); Return TRUE
}
other
{
Returns FALSE
}
}
*/