aewarnick Posted May 5, 2003 Posted May 5, 2003 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? Quote C#
Hornet Posted May 5, 2003 Posted May 5, 2003 Look at this link. Maybee it will help you. Greetz, Hornet Quote
*Gurus* Derek Stone Posted May 5, 2003 *Gurus* Posted May 5, 2003 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. Quote Posting Guidelines
aewarnick Posted May 5, 2003 Author Posted May 5, 2003 I saw that online except it was more complicated: 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) 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. Quote C#
Leaders Squirm Posted May 5, 2003 Leaders Posted May 5, 2003 An in-depth description of the SystemParametersInfo function can be found here: http://www.mentalis.org/apilist/SystemParametersInfo.shtml Quote Search the forums | Still IRCing | Be nice
aewarnick Posted May 6, 2003 Author Posted May 6, 2003 That was useful and I bookmarked it but it never goes over what those arguments do. Quote C#
*Gurus* divil Posted May 6, 2003 *Gurus* Posted May 6, 2003 Why not consult the documentation? MSDN? Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts