要各个版本都能换。。才可以。。谢了

解决方案 »

  1.   

    网上一大把:
    http://tieba.baidu.com/f?kz=160835485
      

  2.   

    回二楼 这个法子 我用过了。。但是WIN7下 没效果
      

  3.   

    没权限,当然不能。
    win7(你好先进,我还在vista)没用过,试试能不能改注册表。
      

  4.   

    patrickkong 如果你用那API 有效吗?
      

  5.   

    我不知道你说的api是怎么用的。
    我知道在Windows(xp)里有时可以改注册表,在没权限的情况下。
      

  6.   

    试看看 兼容性'添加 Drive1 Dir1 File1 Picture1 Command1Option Explicit
    Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
    Dim aa$, AppDisk$, DirPath$, Rtn&
    Const SPI_SETDESKWALLPAPER = 20
    Const SPIF_UPDATEINIFILE = &H1Private Sub Form_Load()
       AppDisk = IIf(Right(App.Path, 1) = "\", App.Path, App.Path & "\")
       Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - Me.Height) \ 2
       Picture1.AutoSize = True
       File1.Pattern = "*.bmp;*.jpg;*.gif"
       Dir1.Path = App.Path
    End SubPrivate Sub Drive1_Change()
       Dir1.Path = Drive1.Drive
    End SubPrivate Sub Dir1_Change()
       File1.Path = Dir1.Path
       DirPath = IIf(Right(Dir1.Path, 1) = "\", Dir1.Path, Dir1.Path & "\")
    End SubPrivate Sub File1_Click()
       Picture1.Picture = LoadPicture(DirPath & File1.FileName)
    End SubPrivate Sub Command1_Click()
       '设为桌面背景图片
       Dim t&, WallPaper$
       On Error Resume Next
       Rtn = MsgBox("您确定将本张图片设置为桌面背景图吗 ?", vbYesNo, "设置桌面背景图")
       If Rtn = 6 Then
          WallPaper = AppDisk & "temp.bmp"
          SavePicture Picture1.Picture, WallPaper
          t = SystemParametersInfo(ByVal SPI_SETDESKWALLPAPER, True, ByVal WallPaper, SPIF_UPDATEINIFILE)
          If t = 0 Then MsgBox "此张图片有问题, 或不适合当桌面!!": Exit Sub
          aa = "              桌面墙纸已更换!!" & vbCrLf & Chr(10)
          aa = aa & "如未更换, 请回到桌面, 鼠标右击可看到刷新两字" & vbCrLf & Chr(10)
          aa = aa & "点击它刷新页面, 新的桌面既刻呈现在您眼前" & vbCrLf & Chr(10)
          MsgBox aa
       End If
    End Sub
      

  7.   

    貌似 13楼 也用的是 SystemParametersInfoA 这个路子在XP 一下有用  高于XP 就不行了。。还有别的办法吗?
      

  8.   

    看看能不能修改HKEY_CURRENT_USER\Control Panel\Desktop\WallPaper 的值。
    修改注册表的网上一大筐,自己查吧。