Главная страница | назад





Article #19481: How do I change the Windows wallpaper to tiled

 Question and Answer Database
FAQ4481C.txt — How do I change the Windows wallpaper to tiled
Category :VCL
Platform :All-32Bit
Product :All-32Bit,
Question:
How do I change the Windows wallpaper to tiled in code using C++Builder?
Answer:
To tile Windows wallpaper set the key:
HKEY_CURRENT_USER\Control Panel\Desktop\TileWallpaper
to 1 for tiled or 0 for not tiled.
TRegistry *registry = new TRegistry();
registry->RootKey = HKEY_CURRENT_USER;
registry->OpenKey("Control Panel\\Desktop", true);
// "1" is tiled. "0" is not tiled.
registry->WriteString("TileWallpaper", "1");
delete registry;
// Refresh the background
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0,
NULL, SPIF_UPDATEINIFILE);
3/22/99 2:05:40 PM

Last Modified: 01-SEP-99