Sign in to follow this  
Followers 0
Valuater

IE Help on Window ...handle?

12 posts in this topic

#1 ·  Posted (edited)

demo script...

#include <IE.au3>

$File = FileOpenDialog("VirusTotal", @DesktopDir, "All (*.*)" )
$oIE = _IECreate("http://www.virustotal.com")
$hwnd = _IEPropertyGet($oIE, "hwnd")
$oForm = _IEFormGetCollection($oIE, 0)
$oFile = _IEGetObjByName($oForm, "archivo")
$oFile.focus
ControlSend($hwnd, "", "Internet Explorer_Server1", $File)
Sleep(750)
    
_IEFormImageClick($oForm, "/images/en_boton-enviar.png", "src")

; How to get the handle/control of that black screen GUI or IE Window ?

looking for the handle of the black screen window... and / or how to time when its done

Thx

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites



Sorry Val, can you be more specific about what you are trying to get? Every time I try your sample code I get:

0 bytes size received / Se ha recibido un archivo vacio

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Sorry Val, can you be more specific about what you are trying to get? Every time I try your sample code I get:

0 bytes size received / Se ha recibido un archivo vacio

Dale

I get that too, but if I manually plug in the same filename (using the site's browse button) then it takes it and runs with it...

So is it not even acknowledging his input as valid in the first place even though he's using controlsend?

Edited by exodius

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Dale the full code is available to MVP's

This was a cut-out from that, I used pixelgetcolor in the original, however it has to be active to use it and i use this 1 to 3 times a day

8)

EDIT: TESTED AGAIN.... OK FOR ME

I have no problems with this..

#include <IE.au3>

$File = FileOpenDialog("VirusTotal", @DesktopDir, "All (*.*)" )
$oIE = _IECreate("http://www.virustotal.com")
$hwnd = _IEPropertyGet($oIE, "hwnd")
$oForm = _IEFormGetCollection($oIE, 0)
$oFile = _IEGetObjByName($oForm, "archivo")
$oFile.focus
ControlSend($hwnd, "", "Internet Explorer_Server1", $File)
Sleep(750)
   
_IEFormImageClick($oForm, "/images/en_boton-enviar.png", "src")

; How to get the handle/control of that black screen GUI or IE Window ?

thx

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Regarding the black screen, I think this is possible:

While IsObj(_IEGetObjById($oIE, 'opaco') ; a DIV element, may not be considered object?
     Sleep(20)
WEnd

About the scan I think it's somehow possible to loop until the span is inlined:

<span id="status_terminado" style="display: none;">finished</span>

If it's "display: inline" then it's the state.

Edit: or maybe until this style: inline; becomes style: none; (it's the animation progress bar):

<div id="status_cargador" style="display: inline;"><img width="220" height="19" border="0" alt="" src="/img/loader.gif"/></div>
Edited by Authenticity

Share this post


Link to post
Share on other sites

Regarding the black screen, I think this is possible:

While IsObj(_IEGetObjById($oIE, 'opaco') ; a DIV element, may not be considered object?
     Sleep(20)
WEnd

About the scan I think it's somehow possible to loop until the span is inlined:

<span id="status_terminado" style="display: none;">finished</span>

If it's "display: inline" then it's the state.

Very good Authenticity.. That is what I originally had with some help from dale

However, test this... upload the same file twice and it does not work.

Tha'ts why I need to know when this "black" window is done... and not pixel use either. I want to use this in-active

thx

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I think that will work Authenticity

While IsObj(_IEGetObjById($oIE, 'opaco') ; a DIV element, may not be considered object?
     Sleep(20)
WEnd

Sorry for the rush to condemn... lol

8)

EDIT: I thought it worked.. but, It would not let the script continue, it stayed in the loop!

thx

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

Hmm, uploading the same file involve with a new page stating this file has already been analyzed so I think the first thing before check the style: inline; stuff is to check it IE is on this page.

Share this post


Link to post
Share on other sites

Hmm, uploading the same file involve with a new page stating this file has already been analyzed so I think the first thing before check the style: inline; stuff is to check it IE is on this page.

Not a problem, that part is already done. it's just the black foreground that is a problem.

Remember, I have this working... just using pixel get color on that black screen

Thx

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#include <IE.au3>

$sFile = @ScriptDir & '\Test.au3'
$oIE = _IECreate("http://www.virustotal.com")
$hwnd = _IEPropertyGet($oIE, "hwnd")
$oForm = _IEFormGetCollection($oIE, 0)
$oFile = _IEGetObjByName($oForm, "archivo")
$oFile.focus

ClipPut($sFile)
ControlSend($hwnd, "", "Internet Explorer_Server1", '^v')
Sleep(750)
   
_IEFormImageClick($oForm, "/images/en_boton-enviar.png", "src", 0, 0)



ConsoleWrite('1' & @LF)
While 1
    Sleep(200)
    $oSpan = _IEGetObjById($oIE, 'status_terminado')
    If $oSpan <> 0 Then ExitLoop
WEnd
Sleep(1000)

ConsoleWrite('2' & @LF)
While $oSpan.style.display <> "inline" ; Or $oSpen.style.display = 'none' ;]
    Sleep(200)
WEnd

ConsoleWrite('3' & @LF)

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Similar to Authenticity 's suggestion, this worked for me:

While IsObj(_IEGetObjById($oIE, "envio"))
    ConsoleWrite(".")
    Sleep(500)
Wend

It produced this both on a new file and one that had already been analyzed:

...........................................--> IE.au3 V2.4-0 Warning from function _IEGetObjById, $_IEStatus_NoMatch (envio)

(the loop exited after the warning -- you can suppress the warning with _IEErrorNotify)

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Testing... Testing....

Thx Guys!

8)

EDIT: They both work thx... and thanks for the info on _IEErrorNotify

Edited by Valuater

NEWHeader1.png

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