Jump to content

_IEAttach fails after a "Windows Explorer has stopped working" error


 Share

Recommended Posts

I have a problem trying to use _IEAttach to recover control after a Windows Explorer reset (e.g. on Windows 7), since all the 

InternetExplorer.Application objects appear to be destroyed by this event. An example of this is when a PC has some kind of fault causing a pop-up error message "Windows Explorer has stopped working". I can simulate this event by using Windows Task Manager to end the Explorer.exe process then to file, new task (run...) Explorer.exe

After this event, _IEAttach gives an @error of: 

7 ($_IEStatus_NoMatch) - No Match

However, using WinList() followed by WinGetText() I can recover the URL for an IE session that has lost its 

InternetExplorer.Application object which could be used to _IECreate a new session (the $iTryAttach fails) and WinKill() the original session but the result is a if a refresh had been done (any form entries are lost) . Unfortunately form entries do not appear as text or hidden text to Windows so I'm looking for the best way to read the contents of an Internet Explorer screen (even if just text without structure). 

When there is no InternetExplorer.Application object (because of some Windows fault) but still with an Internet Explorer session running, I tried to read its contents by a "Select All" & "Copy to Clipboard" but its form entries are blanked and combo boxes choices are all displayed with no way of finding out which ones were selected.

Local $ClipBoardSave = _ClipBoard_GetData() ;not ClipGet() which is text only
ClipPut("") ;Clear User's Clipboard
Local $sText = "" 
Local $hWnd = WinActivate("Window Title", "")
If IsHWnd($hWnd) Then Local $bStatusCtrlSend = ControlSend("Window Title", "", "", "^a^c")
If $bStatusCtrlSend Then Local $bStatusCtrlClick = ControlClick("Window Title", "", "")
If $bStatusCtrlClick Then $sText = ClipGet()
_ClipBoard_SetData($ClipBoardSave) ;not ClipPut($ClipBoardSave) which is text only

 

Is  there a solution to this please?

Edited by Tippex
Link to comment
Share on other sites

Important part here is to stop explore from crashing that should never happen. Get windows fixed. 

Explorer is your main shell it runs everything if it screws up you are hosed and it means your windows is hosed usually

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
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
 Share

×
×
  • Create New...