Sign in to follow this  
Followers 0
peter123

Problem with the desktop background

11 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

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

Share this post


Link to post
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 )

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

wel I was wondered.

can i not direct opened this image in the background without i downloaded this file?

Share this post


Link to post
Share on other sites

you can embed IE or just download the way you are, but to the temp folder, and delete on exit

Share this post


Link to post
Share on other sites

why does the picture lay over the buttons , is it possible to set it as backround?

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