Results 1 to 2 of 2

Thread: URGH!

  1. #1

    Thread Starter
    Hyperactive Member Sacofjoea's Avatar
    Join Date
    May 2000
    Location
    Never Never Land
    Posts
    472
    can someone tell me what is wrong with this code... I am trying to use it to make it change my desktop background..(i got this from the form here...but isn't working)

    Option Explicit
    Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long

    '//CONTANTS NEEDED FOR CHANGING THE WALLPAPER
    Const SPI_SETDESKWALLPAPER = 20

    Private Sub Command1_Click()

    Dim lChangeWP As Long
    Dim sBackground As String

    sBackground = "C:\windows\desktop\wolve.bmp" '//GET THE NEW BACKGROUND
    lChangeWP = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, sBackground, 0) '//SET THE NEW BACKGROUND

    End Sub

    I have changed the first part (up to the mouse click) to Public, and then placed it in a module, and that did nothing... so I put it in the form code, and changed it to Private, then it did nothing...whats wrong?

    This code is supposed to change the background on the desktop, and then refresh the desktop so that it will show the new bg after the button is hit...

  2. #2

    Thread Starter
    Hyperactive Member Sacofjoea's Avatar
    Join Date
    May 2000
    Location
    Never Never Land
    Posts
    472
    hmmm.......it does change it...so how do I refresh the desktop from vb? it seems the refresh didnt work in that code...

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