-
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...
-
hmmm.......it does change it...so how do I refresh the desktop from vb? it seems the refresh didnt work in that code...