Solved

Change WallPaper/Disable Active Desktop

Posted on 2003-10-30
4
358 Views
Last Modified: 2012-05-04
Hi,

I've found a few solutions to changing the wall paper in Visual Basic 6 on this site (code: see below).
However, I have run into two problems:

1) The change itself is temporary - that is if I logoff/logon, the wallpaper disappears. Am I doing something wrong?

2) If the user has active desktop activated (that is checked "Show Web Content on my Active Desktop" in Display Properties->Web) the wallpaper will not be shown. So I'm looking for away to uncheck that "Show Web........" box. I've tried putting in different registry keys (in Windows/CurVers/Policies/Explorer) which supposedly should disable Active Desktop, but rather than disabling the web content, it hides the tab called Web under Display properties, while leaving all prior settings as they were. So if the user had active desktop enabled, now he has not way of disabling it anymore = very clever! :(

Can anyone help me with these issues?

Thank you in advance.

- Erik

Code:

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

Sub Main()

Dim BitmapName As String

BitmapName=".\invi.bmp" 'full path of bitmap

If ChangeWallPaper(BitmapName) then
  MsgBox "Wallpaper was succesfuly changed"
Else
  MsgBox "Wallpaper was not changed"
End If

End Sub

Function ChangeWallPaper(WallPaperFullPath As String) As boolean
Dim Succed As Long

Succed=SystemParametersInfo(SPI_SETDESKWALLPAPER,0,WallPaperFullPath,0)
'Second and Fouth parameters must be zero (0)

  'Succed will be equal to zero (0) if function fails
  IF Succed=0 then
    ChangeWallPaper=false
  Else
    ChangeWallPaper=true
  End If
End Function
0
Comment
Question by:eibsen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 5

Accepted Solution

by:
fantasy1001 earned 125 total points
ID: 9655143
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As String, ByVal fuWinIni As Long) As Long
Const SPIF_UPDATEINIFILE = &H1
Const SPI_SETDESKWALLPAPER = 20
Const SPIF_SENDWININICHANGE = &H2

X = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0&, WallPaperFullPath, SPIF_UPDATEINIFILE Or PIF_SENDWININICHANGE)

As for the "check web...", I am using XP, and the key is at
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Webcheck

Thanks,
fantasy
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows 10 start screen issues 9 61
Excel - Save a copy of work book 13 91
Can we place a tooltip on the actual vb6 form 5 51
pop out of webbrowser1 control vba6 5 41
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…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 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