Solved

Changeing the wallpaper thru code

Posted on 1998-12-17
3
181 Views
Last Modified: 2010-05-03
I am rather new to programing.  I want to write a small app that when run, copies a file to the windows dir then changes the display properties to display my wallpaper.  How can I do this with code??  And with no user interaction?  I cant seem to figure out what microsoft calls it.  Please be specific in your answer so that I can understand it.  Thx
0
Comment
Question by:Zands
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
Dalin earned 100 total points
ID: 1451033
Zands,
Try:
1.  Declaration
          Const SPI_SETDESKWALLPAPER = 20
          Const SPIF_UPDATEINIFILE = &H1
          Private 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

2. Code
          ' Put th picture c:\windows\setup.bmp as wallpaper
          Call SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "c:\windows\setup.bmp", SPIF_UPDATEINIFILE)

 ' get rid of Wall Paper        
          Call SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "", SPIF_UPDATEINIFILE)

Regards
Dalin
0
 

Author Comment

by:Zands
ID: 1451034
It Works!  How can I have it copy a file to the windows dir?(so that I have access to it) FOR EXAMPLE:  If I put a picture in a "picture box" it dosent have to have the picture go with it to be displayed right? it is part of the exe??  how can I copy it if it was hidden on the form to the windows directory?
Do I have to use a setup program or is there a more discrete way?  I want to have some fun with this  :-)
0
 

Author Comment

by:Zands
ID: 1451035
Im sorry one more thing. Since I can change the wallpaper can I change the tile property to turn it on and off ? or the stretch property?  Guess thats two :-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

910 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now