Solved

Wallpaper api?

Posted on 2001-09-04
2
451 Views
Last Modified: 2008-02-01
I just need to know the windows background api name :)
the rest won't be to hard to figure out
0
Comment
Question by:molli500
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 50 total points
ID: 6452786
Option Explicit

Public Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
Public Const SPI_SETDESKWALLPAPER = 20
Public Const SPIF_SENDWININICHANGE = &H2
Public Const SPIF_UPDATEINIFILE = &H1

Public Sub SetWallpaper(ByVal FileName As String)
    Dim lRet As Long
    lRet = SystemParametersInfo(SPI_SETDESKWALLPAPER, _
        0&, FileName, SPIF_SENDWININICHANGE Or SPIF_UPDATEINIFILE)
End Sub

Public Sub Main()
    SetWallpaper Replace(Command(), Chr(34), "")
    End
End Sub

Paste this lot in a module (or wherever) and it can be used to set the wallpaper to the specified bitmap.
0
 
LVL 15

Expert Comment

by:lyonst
ID: 6452787
Is this what you are looking for

http://161.58.84.209/api/tip184.html

' Change the Windows wallpaper using the SystemParametersInfo API.

Private Sub Command1_Click()

Dim t As Long
Dim Wallpaper As String
Dim filename As String

CommonDialog1.Action = 1
filename = CommonDialog1.filename
Wallpaper = filename

If Wallpaper = "" Then Exit Sub
t = SystemParametersInfo(ByVal 20, vbnostring, ByVal Wallpaper, &H1)

If t = 0 Then
  MousePointer = 0
  MsgBox "Error changing wallpaper"
  Exit Sub
End If

End Sub
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question