[Help] Changing Desktop Background
Is there any other codes for changing the desktop background?
This code haven't worked at me. It turns into a black background.
Code:
Imports System.IO
Imports System****ntime.InteropServices
Public Class DeskTop
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Integer, ByVal uParam As Integer, ByRef lpvParam As String, ByVal fuWinIni As Integer) As Long
Private Const SPI_SETDESKTOPWALLPAPER = 20
Private Const SPIF_UPDATEINIFILE = 1
Private Const SPIF_SENDWININICHANGE = 2
Private _WallPaperPath As String
Public Property WallPaperPath()
Get
Return _WallPaperPath
End Get
Set(ByVal Value)
_WallPaperPath = Value
End Set
End Property
Public Sub ChangeWallPaper()
If File.Exists(_WallPaperPath) = True Then
SystemParametersInfo(SPI_SETDESKTOPWALLPAPER, 0, _WallPaperPath, SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE)
Else
Throw New FileNotFoundException("Specify a valid image path")
End If
End Sub
End Class
