Set Desktop

  • Thread starter Thread starter Shane
  • Start date Start date
S

Shane

I have the following code that will change the desktop on my XP machine
to a .BMP file. It doesn't work with a .JPG extention.
Can anybody point me in the right direction?

The full path name to the file is in m_Picture

Const SPI_SETDESKWALLPAPER = 20
Const SPIF_UPDATEINIFILE = &H1
Const SPIF_SENDWININICHANGE = &H2
Private Declare Auto Function SystemParametersInfo Lib "user32" ( _
ByVal uAction As Integer, _
ByVal uParam As Integer, _
ByVal lpvParam As String, _
ByVal fuWinIni As Integer) As Integer

....

Dim l_Result As Integer
If m_Picture <> "" Then
l_Result = SystemParametersInfo(SPI_SETDESKWALLPAPER, _
0&, m_Picture, _
SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE)
End If
 
Shane,

For this you can use the context menu and for saving it the registry.

Both are very easy to use, search for that in your help or on
MSDN.microsoft.com

I hope this helps,

Cor
 
Back
Top