Sign in to follow this  
Followers 0
IcyFerno

Help on controlling wallpaper

4 posts in this topic

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


Share this post


Link to post
Share on other sites



I don't know if it works but i googled and found this...

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop]

"NoChangingWallPaper"=dword:00000001


Sapiente vince, rex, noli vincere ferro!

Share this post


Link to post
Share on other sites

oh my god thanks so much!

now i dont have to bother with the script :wink:

thanks again


Share this post


Link to post
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
Sign in to follow this  
Followers 0