PTN Posted January 21, 2015 Share Posted January 21, 2015 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) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 21, 2015 Moderators Share Posted January 21, 2015 (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 January 21, 2015 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. Link to comment Share on other sites More sharing options...
PTN Posted January 21, 2015 Author Share Posted January 21, 2015 (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 January 21, 2015 by PTN Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 21, 2015 Moderators Share Posted January 21, 2015 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. Link to comment Share on other sites More sharing options...
PTN Posted January 21, 2015 Author Share Posted January 21, 2015 (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 January 21, 2015 by PTN Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 21, 2015 Moderators Share Posted January 21, 2015 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now