Set Desktop

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
 
C

Cor Ligthert

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top