Jump to content

Recommended Posts

Posted

After upgrading to IE 11 from IE 9, we noticed that the line of code below returns a wrong PID and the show_flag stopped working as well.

$rcRun = Run(@ProgramFilesDir & "Internet ExplorerIEXPLORE.EXE -nohangrecovery -extoff http://www.google.com", @ProgramFilesDir & "Internet Explorer", @SW_HIDE)

 

  • Moderators
Posted (edited)

Ok, now my curiosity is peeked.

How exactly do you know it's returned the wrong IP?

And I will say, I have run into this issue with IE before if I was already running one and launched this way.  It returned the primary IE's pid, but that has nothing to do with AutoIt.

Edit:

Also, are you working with this page as an object, or just the PID.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted (edited)

When I ran this line and msgbox'd out the returned PID, I got 6180; however, the get-process command from powershell returned a different PID.  I noticed this because the "ProcessClose" failed to close the process with the returned PID because it can't find it.

$rcRun = Run(@ProgramFilesDir & "Internet ExplorerIEXPLORE.EXE -nohangrecovery -extoff http://www.google.com", @ProgramFilesDir & "Internet Explorer", @SW_HIDE)

MsgBox(0, '', $rcRun)

ProcessClose($rcRun)

 

We have a logon process to access a specific URL in the background and close it after the page is opened.

Edited by PTN
  • Moderators
Posted

And it's the only instance of IE running?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted (edited)

yup.

Even when we have multiple instances of IE opened, the returned PID didn't match up with any active PIDs listed under iexplorer.exe processes.

Edited by PTN
  • Moderators
Posted

Fun times... Like I said, I've seen this happen, when I was trying to capture the browser object from the PID.

See if this works:

'?do=embed' frameborder='0' data-embedContent>>

Download the library... use the _IEJS_CreateWithParams() function.

From your code, it would look something like:

#include "IEJS.au3"; put in same directory as your script
Global $goIEPID = 0
Global $goIE = _IEJS_CreateWithParams("http://www.google.com", "-nohangrecovery -extoff", 0, 0)
If IsObj($goIE) Then
    $goIEPID = WinGetProcess($goIE.hwnd)
EndIf
; $goIEPID has your PID

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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
  • Recently Browsing   0 members

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