/*********************************************************************** * SetDeskWallPaper (USER32.@) * * FIXME: is there a unicode version? */ BOOL WINAPI SetDeskWallPaper( LPCSTR filename ) { HBITMAP hbitmap; HDC hdc; char buffer[256]; if (filename == (LPSTR)-1) { GetProfileStringA( "desktop", "WallPaper", "(None)", buffer, 256 ); filename = buffer; } hdc = GetDC( 0 ); hbitmap = DESKTOP_LoadBitmap( hdc, filename ); ReleaseDC( 0, hdc ); if (hbitmapWallPaper) DeleteObject( hbitmapWallPaper ); hbitmapWallPaper = hbitmap; fTileWallPaper = GetProfileIntA( "desktop", "TileWallPaper", 0 ); if (hbitmap) { BITMAP bmp; GetObjectA( hbitmap, sizeof(bmp), &bmp ); bitmapSize.cx = (bmp.bmWidth != 0) ? bmp.bmWidth : 1; bitmapSize.cy = (bmp.bmHeight != 0) ? bmp.bmHeight : 1; } return TRUE; }
/*********************************************************************** * init_wallpaper */ static void init_wallpaper( const WCHAR *wallpaper ) { HBITMAP hbitmap = DESKTOP_LoadBitmap( wallpaper ); if (hbitmapWallPaper) DeleteObject( hbitmapWallPaper ); hbitmapWallPaper = hbitmap; if (hbitmap) { BITMAP bmp; GetObjectA( hbitmap, sizeof(bmp), &bmp ); bitmapSize.cx = (bmp.bmWidth != 0) ? bmp.bmWidth : 1; bitmapSize.cy = (bmp.bmHeight != 0) ? bmp.bmHeight : 1; fTileWallPaper = GetProfileIntA( "desktop", "TileWallPaper", 0 ); } }