I have a question about switching out the desktop background when the user clicks on one of my pictureboxes in my program.
Right now i'm trying to use this code. it's not throwing an err but it's not working either. I wondering if anyone has any suggestions on this. thanks .
Private Const SPI_SETDESKWALLPAPER As Integer = &H14
Private Const SPIF_UPDATEINIFILE As Integer = &H1
Private Const SPIF_SENDWININICHANGE As Integer = &H2
private path as string = "C:\images\apple.jpg"
Private Declare Auto Function SystemParametersInfo Lib "user32.dll" (ByVal uAction As Integer, ByVal uParam As Integer, ByVal lpvParam As String, ByVal fuWinIni As Integer) As Integer
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, path, SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE)
End Sub
Right now i'm trying to use this code. it's not throwing an err but it's not working either. I wondering if anyone has any suggestions on this. thanks .
Private Const SPI_SETDESKWALLPAPER As Integer = &H14
Private Const SPIF_UPDATEINIFILE As Integer = &H1
Private Const SPIF_SENDWININICHANGE As Integer = &H2
private path as string = "C:\images\apple.jpg"
Private Declare Auto Function SystemParametersInfo Lib "user32.dll" (ByVal uAction As Integer, ByVal uParam As Integer, ByVal lpvParam As String, ByVal fuWinIni As Integer) As Integer
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, path, SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE)
End Sub