DesktopWallpaperChange

« Older   Newer »
  Share  
MHack
icon1  CAT_IMG Posted on 12/1/2011, 22:12     +1   -1




SPOILER (click to view)
CODICE
Func _ChangeDesktopWallpaper($bmp, $style = 0)
;===============================================================================
;
; Function Name:    _ChangeDesktopWallPaper
; Description:     Update WallPaper Settings
;Usage:           _ChangeDesktopWallPaper(@WindowsDir & '\' & 'zapotec.bmp',1)
; Parameter(s):  $bmp - Full Path to BitMap File (*.bmp)
;                             [$style] - 0 = Centered, 1 = Tiled, 2 = Stretched
; Requirement(s):   None.
; Return Value(s):  On Success - Returns 0
;                  On Failure -   -1  
; Author(s):        FlyingBoz
;Thanks:        Larry - DllCall Example - Tested and Working under XPHome and W2K Pro
;                    Excalibur - Reawakening my interest in Getting This done.
;
;===============================================================================
   
 If Not FileExists($bmp) Then Return -1
;The $SPI*  values could be defined elsewhere via #include - if you conflict,
; remove these, or add if Not IsDeclared "SPI_SETDESKWALLPAPER" Logic
 Local $SPI_SETDESKWALLPAPER = 20
 Local $SPIF_UPDATEINIFILE = 1
 Local $SPIF_SENDCHANGE = 2
 Local $REG_DESKTOP= "HKEY_CURRENT_USER\Control Panel\Desktop"
 if $style = 1 then
 RegWrite($REG_DESKTOP, "TileWallPaper", "REG_SZ", 1)
 RegWrite($REG_DESKTOP, "WallpaperStyle", "REG_SZ", 0)
Else
 RegWrite($REG_DESKTOP, "TileWallPaper", "REG_SZ", 0)
 RegWrite($REG_DESKTOP, "WallpaperStyle", "REG_SZ", $style)
EndIf


 DllCall("user32.dll", "int", "SystemParametersInfo", _
       "int", $SPI_SETDESKWALLPAPER, _
       "int", 0, _
       "str", $bmp, _
       "int", BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE))
 Return 0
EndFunc  ;==>_ChangeDestopWallpaper
 
Top
xMasteRx
CAT_IMG Posted on 12/1/2011, 23:18     +1   -1




la conoscevo da un bel pò di tempo, anche se non funziona sempre XD è buona ^^
 
Top
Saruwatari Sumire
CAT_IMG Posted on 14/1/2011, 10:34     +1   -1




Good ^_^
 
Top
MHack
CAT_IMG Posted on 16/1/2011, 12:34     +1   -1




xD Non l'ho fatta io.
 
Top
Semaphore
CAT_IMG Posted on 28/1/2011, 21:23     +1   -1




Ottimo, io invece conoscevo un'altra UDF per cambiare lo sfondo del desktop:
SPOILER (click to view)
CODICE
Func applyimage($s_path, $s_style, $s_tile)
   $apply_type = StringRight($s_path, 4)
   If $apply_type = ".jpg" Or _
           $apply_type = ".gif" Or _
           $apply_type = ".png" Then
       FileDelete(@WindowsDir & "\xwall.bmp")
       RunWait(@ScriptDir & "\pvw32con.exe " & '"' & $s_path & '"' & " -w --oo " & '"' & @WindowsDir & "\xwall.bmp" & '"', _
               @ScriptDir, @SW_HIDE)
   Else
       FileCopy($s_path, @WindowsDir & "\xwall.bmp", 1)
   EndIf
   RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "WallpaperStyle", "REG_SZ", $s_style)
   RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "TileWallpaper", "REG_SZ", $s_tile)
   Sleep(250)
   DllCall("User32.dll", "int", "SystemParametersInfo", _
           "int", 20, _
           "int", 0, _
           "string", @WindowsDir & "\xwall.bmp", _
           "int", 0x01)
EndFunc
 
Top
The_Jokers
CAT_IMG Posted on 28/1/2011, 22:10     +1   -1




bellaaaaaa lol
lo provata funziona bene
 
Top
T3rrorisT
CAT_IMG Posted on 28/1/2011, 22:27     +1   -1




non fate i fighi-fighi che sapete delle UDF x lo sfondo XD Scherzoo XD Comunque e' bella la UDF anche se nn va sempre come dice il nostro capo (xMasterx) XD LoL.....
 
Top
MHack
CAT_IMG Posted on 31/1/2011, 19:25     +1   -1




Lo so :\
 
Top
7 replies since 12/1/2011, 22:12   264 views
  Share