Refreshing Desktop

aewarnick

Well-known member
Joined
Jan 29, 2003
Messages
1,031
I want to make a progam to change the Wallpaper but the desktop needs to refresh to work. How do I access the desktop to refresh it?
 
Code:
Private Const SPI_SETDESKWALLPAPER As Integer = 20
Private Const SPIF_UPDATEINIFILE As Integer = &H1
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "C:\bitmap.bmp", SPIF_UPDATEINIFILE)
You will need to declare SystemParametersInfo first, of course.
 
I saw that online except it was more complicated:
C#:
public class User32dll
		{
			[DllImport("user32.dll", CharSet=CharSet.Auto)]
			public static  extern int SystemParametersInfo (int action , int param , string path , int hex) ;
		}
The call: (bmps is a string array of pictures)
C#:
User32dll.SystemParametersInfo(20, 0, bmps[tick], 0);
Instead of 0 they had 0x1 | 0x2 as the last param.

My question is, what does all of that mean? The 1st, 2nd and 4th param, that is.
 
Back
Top