Solved

Changeing the wallpaper thru code

Posted on 1998-12-17
3
202 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
using Access 8 76
Access Object Property from VBA Module in Excel 2010 2 37
Problem to With line 4 63
Export Data to Different .csv Files 26 115
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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 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…

820 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