Jump to content

Help on controlling wallpaper


IcyFerno
 Share

Recommended Posts

i was just wondering if anyone of you could leave any comments. i need to run this script on one of my house computers as my brother always changes the wallpaper. i figured i could do this script as the administrative rights will still be retained. (my brother is below 12 :whistle:)

Code:

#NoTrayIcon

Global $reg

Global Const $dsw = @DesktopWidth

Global Const $dsh = @DesktopHeight

Global Const $Temp = @TempDir

Global Const $url = "http://www.n4ls.net/tmp/background/index.php?w=" & $dsw & "&h=" & $dsh & ""

Global Const $picture = ""& $Temp & "\Picture.bmp"

If FileExists ($Picture) Then

$sizenet = INetGetSize ($url)

$sizelocal = FileGetSize ($Picture)

If $sizenet = $sizelocal Then

$reg = RegWrite( "HKEY_CURRENT_USER\Control Panel\Desktop", "WallpaperStyle", "REG_SZ", "2" )

$reg += RegWrite( "HKEY_CURRENT_USER\Control Panel\Desktop", "TileWallpaper", "REG_SZ", "0" )

$reg = DllCall( "User32.dll", "int", "SystemParametersInfo", "int", 20, "int", 0, "string", $picture, "int", 0x02 )

Else

INetGet ($url, $Picture)

$reg = RegWrite( "HKEY_CURRENT_USER\Control Panel\Desktop", "WallpaperStyle", "REG_SZ", "2" )

$reg += RegWrite( "HKEY_CURRENT_USER\Control Panel\Desktop", "TileWallpaper", "REG_SZ", "0" )

$reg = DllCall( "User32.dll", "int", "SystemParametersInfo", "int", 20, "int", 0, "string", $picture, "int", 0x02 )

EndIf

ElseIf Not FileExists ($Picture) Then

INetGet ($url, $Picture)

$reg = RegWrite( "HKEY_CURRENT_USER\Control Panel\Desktop", "WallpaperStyle", "REG_SZ", "2" )

$reg += RegWrite( "HKEY_CURRENT_USER\Control Panel\Desktop", "TileWallpaper", "REG_SZ", "0" )

$reg = DllCall( "User32.dll", "int", "SystemParametersInfo", "int", 20, "int", 0, "string", $picture, "int", 0x02 )

EndIf

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...