ken82m Posted November 3, 2008 Posted November 3, 2008 (edited) Is it possible to get the PID of the process created by _IECreate The page my script is going to sometimes triggers a MsgBox relating to MediaPlayer about upgrading some DRM licenses. I get what I need and issue an _IEQuit but it won't close while that pop up is there. Is it possible to get the PID so I can issue a ProcessClose() in case _IEQuite doesn't work? Thanks, Kenny Edited November 3, 2008 by ken82m "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."
Moderators SmOke_N Posted November 3, 2008 Moderators Posted November 3, 2008 WinGetProcess(_IEPropertyGet($o_ie, "hwnd")) ? 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.
ken82m Posted November 3, 2008 Author Posted November 3, 2008 Thanks Based on your idea I just added this to my IE.au3 under _IEPropertyGet in case I need it again. Case $s_property = "PID"; Added by Kenny - Based on HWND If Not __IEIsObjType($o_object, "browser") Then __IEErrorNotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType") SetError($_IEStatus_InvalidObjectType, 1) Return 0 EndIf SetError($_IEStatus_Success) Return WinGetProcess(HWnd($o_object.HWnd())); Will return 0 if PID was not found Now I can just call _IEPropertyGet($IE, "PID") Thanks, Kenny "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."
GoogleDude Posted September 23, 2013 Posted September 23, 2013 Sorry to revive an old post but it help me almost do what I wanted to. Problem now is that it closes all IE Tabs including other IE windows that I have open. how can I get it to only close the tab or window that was created with _iecreate? Thanks, ~GD
jguinch Posted September 23, 2013 Posted September 23, 2013 You can try with _IEAttach and _IEQuit() to close the tab. Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
GoogleDude Posted September 23, 2013 Posted September 23, 2013 I can get the pid and close ie using the below code but even if "Test" is in a seperate ie window all by its self the below code closes ALL ie windows and tabs. im looking to only close the tab or window with title "Test" in the webpage title. #include <IE.au3> $iepid = _IEAttach("Test") $hwnd = _IEPropertyGet($iepid, "hwnd") Local $pid = WinGetProcess(_IEPropertyGet($iepid, "hwnd")) ProcessClose($pid) ~GD
DaleHohm Posted September 23, 2013 Posted September 23, 2013 Use _IEQuit($iepid) GoogleDude 1 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
GoogleDude Posted September 23, 2013 Posted September 23, 2013 HA. As always DaleHohm your advise works. Thanks. ;P
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