Click to See Complete Forum and Search --> : Set Window Wallpaper
Hello,
Which API I should call in order to change window's Wallpaper? Thank!
I don't know about API but if you ant, I could give you a code using the registry.
The API to access the control panel elements is SystemParametersInfo.. u can retrieve and set almost anything in the control panel w/ this one... if ya want detailed code in vb on changin the wallpaper, just lemme know...
CiD -=ii=-
Thank CiD. Please also give me detail of code on it, Thank a lot!!
Sure, heres the code:
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
Private Const SPI_SETDESKWALLPAPER = 20
Private Const SPIF_UPDATEINIFILE = &H1
Private Const SPIF_SENDWININICHANGE = &H2
Private Sub cmdWallPaper_Click()
Dim rc As Long
rc = SystemParametersInfo(SPI_SETDESKWALLPAPER, _
0&, ByVal "C:\WINDOWS\MYBMP.BMP", _
SPIF_UPDATEINIFILE Or _
SPIF_SENDWININICHANGE)
End Sub
The parameters passed r:
uAction - param to retrieve or set, its a constant in the API viewer that starts w/ SPI_
uParam - value depends on action, or if retrieving set it to 0
lpvParam - the value to be set, or returns setting when uParam is set to 0
fuWinIni - changes to make to the win.ini (UPDATEINIFILE saves the settings to the user's profile. SENDWININICHANGE broadcasts a system change to all other apps.)
Hope this helps..
CiD -=ii=-
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.