Results 1 to 7 of 7

Thread: Changing Windows Wallpaper using Managed Code? [Resolved]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Ideas Man's Avatar
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    1,718

    Question Changing Windows Wallpaper using Managed Code? [Resolved]

    In VB6 i have this terrific piece of code that i use to change the Windows wallpaper. It changes JPEGs, BMPs etc. How would i do this in VB.NET 2003? Any ideas?

    VB Code:
    1. Private Declare Function SystemParametersInfo Lib "user32" Alias _
    2.   "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, _
    3.   ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
    4.  
    5.  
    6. Private Const SPIF_SENDWININICHANGE = &H2
    7. Private Const SPIF_UPDATEINIFILE = &H1
    8. Private Const SPI_SETDESKWALLPAPER = 20

    VB Code:
    1. SavePicture pPicture, "C:\WINDOWS\Web\Wallpaper\Current Wallpaper.bmp"
    2.    
    3.     ret = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, ByVal "C:\WINDOWS\Web\Wallpaper\Current Wallpaper.bmp", _
    4.     SPIF_SENDWININICHANGE Or SPIF_UPDATEINIFILE)
    Last edited by Ideas Man; May 21st, 2004 at 09:44 PM.
    I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width