Jump to content

Problem with the desktop background


Recommended Posts

hello everyone,

i have got the next problem:

I can't get any pictures from the internet when I want them to be my desktop background.

I use these two codes

I need to add these two codes, which won't work...

$destination = @Systemdir & "\oobe\images\mslogo.jpg"

SplashImageOn("Splash Screen", $destination,250,50)

Sleep(3000)

SplashOff()

and:

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")

$oHTTP.Open("GET","http://127.0.0.1/test.php")

$oHTTP.Send()

$HTMLSource = $oHTTP.Responsetext

MsgBox(0, "Info", $HTMLSource )

for example when I want to put the google image as my desktop background:

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")

$oHTTP.Open("GET","http://www.google.nl/intl/nl_nl/images/logo.gif")

$oHTTP.Send()

I receive the image now but how can I show it?

$destination = $oHTTP.image??

SplashImageOn("Splash Screen", $destination,250,50)

Sleep(3000)

SplashOff()

Thnx Peter

Edited by peter123
Link to comment
Share on other sites

ok, nice it works :whistle:

but, how can I set a Backgroundimage

I found the code GUISetBkcolor, but not a code to set a background image.

I want this:

//if open program create the background image in the director dir:
DirCreate("dir")
InetGet("http://www.google.nl/intl/nl_nl/images/logo.gif", "dir/logo.gif", 1, 1)

//then I must get the image in the background....


//when the program closed then remove I the director with the image.
DirRemove("dir", 1)
Edited by peter123
Link to comment
Share on other sites

i do this to update wallpaper

must be a .bmp ,

Dim $picture
Dim $err

$picture = (@ScriptDir & '\d.bmp')
$err = RegWrite( "HKEY_CURRENT_USER\Control Panel\Desktop", "WallpaperStyle", "REG_SZ", "2" )
$err = RegWrite( "HKEY_CURRENT_USER\Control Panel\Desktop", "TileWallpaper", "REG_SZ", "0" )
$err = DllCall( "User32.dll", "int", "SystemParametersInfo", "int", 20, "int", 0, "string", $picture, "int", 0x02 )
Link to comment
Share on other sites

ehh, sorry.

what I was mean with background was not the desktop-background.

what I was mean was the Background of a program.

this is a example code of a Background color.

#include <GUIConstants.au3>

GUICreate("Program") 
GUISetState (@SW_SHOW)  



GUISetBkColor(0x00E0FFFF)
GUISetFont(9, 300)


While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

this code gives the background COLOR and what I want is the Background IMAGE.

Can anybody help me??

Edited by peter123
Link to comment
Share on other sites

my bad , but i dont know any ctrl to do this ,

If as was u , u should try with "GUICtrlCreatePic" then just put the other control over it.

gonna look like that

$gui = GUICreate("My GUI picture",350,300,-1,-1,$WS_SIZEBOX+$WS_SYSMENU) ; will create a dialog box that when displayed is centered

$ParentWin_Pos = WinGetPos($gui, "")

$x = $ParentWin_Pos[0] 
$y = $ParentWin_Pos[1]

GUISetBkColor (0xE0FFFF)
$n=GUICtrlCreatePic(@Systemdir & "\oobe\images\mslogo.jpg",$ParentWin_Pos[0],$ParentWin_Pos[1])

GUISetState ()

; Run the GUI until the dialog is closed



GUISetState ()
; resize the control
$n=GUICtrlSetPos($n,50,50,200,100)
; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Link to comment
Share on other sites

yess, thnx.

it works

this is the code

DirCreate("dir")
InetGet("http://www.google.nl/intl/nl_nl/images/logo.gif", "dir/logo.gif", 1, 1)


$gui = GUICreate("My GUI picture",350,300,-1,-1) 

$ParentWin_Pos = WinGetPos($gui, "")

$x = $ParentWin_Pos[0] 
$y = $ParentWin_Pos[1]

GUISetBkColor (0xE0FFFF)
$n=GUICtrlCreatePic("dir/logo.gif",$ParentWin_Pos[0],$ParentWin_Pos[1])

GUISetState ()




$n=GUICtrlSetPos($n,50,50,200,100)


While 1
    $msg = GUIGetMsg()

Wend

But the program can`t shut down :S

if the shut down works can i remove the dir if the program closed

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...