?
Solved

Changeing the wallpaper thru code

Posted on 1998-12-17
3
Medium Priority
?
227 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 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…
Suggested Courses

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