Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Changeing the wallpaper thru code

Posted on 1998-12-17
3
Medium Priority
?
238 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
[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
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
Dalin earned 400 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

609 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