Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" _
(ByVal uAction As Integer, ByVal uParam As Integer, ByVal lpvParam As String, ByVal fuWinIni As Integer) _
As Integer
'''
''' Changes the desktop background image
'''
'''
Path to the image
''' Makes changes to keep the image after a reboot
'''
Public Sub ChangeBackground(ByVal FileName As String, ByVal KeepAfterBoot As Boolean)
Try
If KeepAfterBoot = True Then
SystemParametersInfo(20, 0, FileName, 1)
Else
SystemParametersInfo(20, 0, FileName, 0)
End If
Catch ex As Exception
MsgBox(ex)
End Try
End Sub
0 Response for the "changing background using vb.net"
Post a Comment