Results 1 to 11 of 11

Thread: Change Wallpaper (Resolved)

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Mushroom Realm's Avatar
    Join Date
    Mar 2002
    Location
    Murrieta, California
    Posts
    650

    Change Wallpaper (Resolved)

    I'm using this code to choose a random picture from a folder that I have selected and then change the wallpaper to it. The problem is that the wallpaper doesn't actually change. What have I done wrong?
    VB Code:
    1. 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
    2. Sub Main()
    3. Dim pic() As String
    4. Dim file As String
    5. Dim path As String
    6. Dim count As Integer
    7. Dim i As Integer
    8. Randomize Timer
    9. path = "C:\Windows\Desktop\Graphics\Desktops\"
    10. file = Dir(path)
    11. Do While file <> ""
    12. If file <> "." And file <> ".." Then
    13. ReDim Preserve pic(count)
    14. pic(count) = file
    15. count = count + 1
    16. End If
    17. file = Dir
    18. Loop
    19. i = Round(Rnd * count)
    20. SystemParametersInfo 20, 0, path & pic(i), &H1
    21. End Sub
    Last edited by Mushroom Realm; Jun 13th, 2003 at 04:22 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width