Skorpion Posted November 3, 2018 Share Posted November 3, 2018 Arkaplan degistirme kod hatasi Selam arkadaslar bir script var bununla önceden masaüstü arka plani sorunsuz degistiriyordum yanlislikla biryerinimi degistirdim naptim simdi calismiyor hata nerede acaba bakabilirmisiniz #RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=..\test2.ico #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Dim $favDir = @MyDocumentsDir & "\Wall\" Dim $cCounter = 0 Dim $FindFile = FileFindFirstFile($favDir & '*.bmp') While 1 FileFindNextFile($FindFile) If @error Then ExitLoop $cCounter = $cCounter + 1 WEnd FileClose($FindFile) $FindFile = FileFindFirstFile($favDir & '*.bmp') Dim $RandomNum = Random(1, $cCounter, 1) Dim $curFile For $i = 1 To $RandomNum $curFile = FileFindNextFile($FindFile) If $RandomNum = $i Then ChangeDesktopWallpaper($favDir & $curFile) ExitLoop EndIf Next FileClose($FindFile) Exit Func ChangeDesktopWallpaper($bmp) ;=============================================================================== ; Usage: _ChangeDesktopWallPaper(@WindowsDir & '\' & 'zapotec.bmp') ; Parameter(s): $bmp - Full Path to BitMap File (*.bmp) ; Requirement(s): None. ; Return Value(s): On Success - Returns 0 ; On Failure - -1 ;=============================================================================== 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" ;Don't tile - just center RegWrite($REG_DESKTOP, "TileWallPaper", "REG_SZ", 0) RegWrite($REG_DESKTOP, "WallpaperStyle", "REG_SZ", 0) RegWrite($REG_DESKTOP, "Wallpaper", "REG_SZ", $bmp) DllCall("user32.dll", "int", "SystemParametersInfo", _ "int", $SPI_SETDESKWALLPAPER, _ "int", 0, _ "str", $bmp, _ "int", BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE)) Return 0 EndFunc;==>_ChangeDestopWallpaper Quote Link to comment Share on other sites More sharing options...
KiNGHaZe Posted November 3, 2018 Share Posted November 3, 2018 En altta destop yazmışsın acaba yapıştırırken mi yanlış yapıştırdın yoksa kodun mu öyle 1 Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted November 3, 2018 Share Posted November 3, 2018 Selam, Uzantıları değiştirmiş olabilir misin? Bende jpg yaptığım zaman gayet güzel çalışıyor. #RequireAdmin #region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=..\test2.ico #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** Dim $favDir = @DesktopDir & "\Wall\" Dim $cCounter = 0 Dim $FindFile = FileFindFirstFile($favDir & '*.jpg') While 1 FileFindNextFile($FindFile) If @error Then ExitLoop $cCounter = $cCounter + 1 WEnd FileClose($FindFile) $FindFile = FileFindFirstFile($favDir & '*.jpg') Dim $RandomNum = Random(1, $cCounter, 1) Dim $curFile For $i = 1 To $RandomNum $curFile = FileFindNextFile($FindFile) If $RandomNum = $i Then ChangeDesktopWallpaper($favDir & $curFile) ExitLoop EndIf Next FileClose($FindFile) Exit Func ChangeDesktopWallpaper($bmp) ;=============================================================================== ; Usage: _ChangeDesktopWallPaper(@WindowsDir & '\' & 'zapotec.bmp') ; Parameter(s): $bmp - Full Path to BitMap File (*.bmp) ; Requirement(s): None. ; Return Value(s): On Success - Returns 0 ; On Failure - -1 ;=============================================================================== 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" ;Don't tile - just center RegWrite($REG_DESKTOP, "TileWallPaper", "REG_SZ", 0) RegWrite($REG_DESKTOP, "WallpaperStyle", "REG_SZ", 0) RegWrite($REG_DESKTOP, "Wallpaper", "REG_SZ", $bmp) DllCall("user32.dll", "int", "SystemParametersInfo", _ "int", $SPI_SETDESKWALLPAPER, _ "int", 0, _ "str", $bmp, _ "int", BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE)) Return 0 EndFunc ;==>ChangeDesktopWallpaper 1 Quote Link to comment Share on other sites More sharing options...
Skorpion Posted November 3, 2018 Author Share Posted November 3, 2018 (edited) ahh ah hep bu üsengencligimden kaynaklaniyormus eski sürüm autoit yüklü oldugu icin calismiyormus simdi hemen oturup ne kadar program varsa hepsini güncelleyecegim yardimlariniz icin cok tesekkür ederim sagolun Edited November 3, 2018 by Skorpion 1 Quote Link to comment Share on other sites More sharing options...
KiNGHaZe Posted November 3, 2018 Share Posted November 3, 2018 64 Bit derlemişsin büyük ihtimal açamayacaklar. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.