Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A Simple One - how to change desktop wallpeper (background)

Status
Not open for further replies.

WarHeart

Programmer
Mar 5, 2005
1
BG
PLZ somebody help me.
I created a program to change my desktop wallpaper by just changing the file Wallpaper1.bmp in Local Settings directory. But I Have this problem - it changes the file but I must press F5 at the desktop to see the change. I tryed repaintwindow(), updatewindow();
SystemParametersInfo(
SPI_SETDESKWALLPAPER,
0,
Nil,
SPIF_SENDWININICHANGE );
but nothing works, or I am doing it wrong. PLZ HELP
 
This works for me (szBuf contains the path to the file):

SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (void*)szBuf, SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE);

You could also try SendNotifyMessage( GetDesktopWindow(), WM_REPAINT, 0, 0);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top