Wallpapers in win95

How do you change the wallpaper in win95 using VB5.0? Every one on my computer
has their own login and I only want to change it for my profile not every one.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

There's an API call to do that.  I don't remember which function.  If I have time tonight, I'll check it.

          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

' 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)
xer_softAuthor Commented:
This does not work! The only thing I changed is to make the function work anywhere in the program...
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Then you need to declare in a module:

                 Public 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
xer_softAuthor Commented:
DQ- Thank you very much. This works great! I thank you very much. You have the points as far as I am concerned with an A  but if you please can answer this one more queston I will up the points to 70. How do you change other things like to tile an immage or not to tile an image. That is really my only other question. If you don't have an answer post another answer saying something and I will give you your 50 points.
  I am not sure what you are asking, DO you want to tile a bitmap?
Here is the code:

         #If Win32 Then
             Declare Function BitBlt Lib "gdi32" _
             (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, _
             ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, _
             ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
             Declare Function BitBlt Lib "gdi" (ByVal hDestDC As Integer, _
             ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, _
             ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal xSrc As Integer, _
             ByVal ySrc As Integer, ByVal dwRop As Long) As Integer
         #End If
         Const SRCCOPY = &HCC0020

  ' As you can see here I used conditional compilation to use the proper API call
  'for either the 32 bit or 16 bit environment.

 ' Now we will make the TilePicture procedure that will tile the picture passed
'to it onto the form. Go ahead and enter the code as you see it below.

         Public Sub TilePicture(frmDest As Form, picSource As PictureBox)
             Dim iPicWidth As Integer
             Dim iPicHeight As Integer
             Dim iFormWidth As Integer
             Dim iFormHeight As Integer
             Dim x As Integer
             Dim y As Integer
             Dim iResult As Integer
             Dim iOldScale As Integer
             'Get the picture width and height in pixels
             iOldScale = picSource.ScaleMode
             picSource.ScaleMode = 3
             iPicWidth = picSource.ScaleWidth
             iPicHeight = picSource.ScaleHeight
             picSource.ScaleMode = iOldScale
             'Get the Forms width and height in pixels
             iFormWidth = frmDest.Width / Screen.TwipsPerPixelX
             iFormHeight = frmDest.Height / Screen.TwipsPerPixelY
             For x = 0 To iFormWidth Step iPicWidth
                 For y = 0 To iFormHeight Step iPicHeight
                     iResult = BitBlt(frmDest.hDC, x, y, iPicWidth, iPicHeight, _
                     picSource.hDC, 0, 0, SRCCOPY)
         End Sub

   '     As you can see we are passsing two parameters to this function.
'         The destination form and the source picture.

'         The first thing we do is get the width of the source picture in pixels.
'    In this example I temporarily change the Scalemode to pixels then after
'     I get the  width and height I change it back.

' Next I get the Form width and height. I did this differently than the Picture just
' to show a different way to do the same thing.

'  Finally we loop through the x and y values and BitBlt the picture onto the form.

'         Now to test this procedure you will need to create a new form and place
'    a picturebox anywhere on the form. Set the picture property to anybitmap.
'         Try a smaller bitmap so you can see that it is tiling properly.

'         In the Form_Paint event insert this code.

         Private Sub Form_Paint()
             TilePicture Me, Picture1
         End Sub
xer_softAuthor Commented:
DQ - I'm sorry for not being more clear... What I meant what if you wanted to tile a bitmap for use as a walpaper. When you go into the control panal ... display... backround   you get all kinds of other properties like pattern, wallpaper, and display. I would like to know how to change the display from tile to center or center to tile. Please forgive me for not being more clear. But that is a nice example of Bitblt! Don't worry the points are still yours! If you don't know this then I will ask a new Question some other time. Thank you very much.
I don't think I know the answer, nor the question. you can using the tile code when you want to tile it, and not using it if you don't want.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
xer_softAuthor Commented:
This is good enough. Thanks a bunch for all the help!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.