Cum poti schimba wallpaperul de pe desktop din Visual Basic
Option Explicit
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
Private Const SPIF_SENDWININICHANGE = &H2
Private Const SPIF_UPDATEINIFILE = &H1
Private Const SPI_SETDESKWALLPAPER = 20
Private Sub Form_Load()
ChangeWallPaper
End
End Sub
Private Sub ChangeWallPaper()
Dim ret As Long
Dim t As Integer
fl.Path = App.Path
fl.Pattern = "*.bmp;*.jpg"
fl.Refresh
Randomize
t = Int((fl.ListCount * Rnd))
ret = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0&, fl.Path & "\" & fl.List(t), SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE)
End Sub
joi, 10 iulie 2008
Abonați-vă la:
Postare comentarii (Atom)
Niciun comentariu:
Trimiteți un comentariu