0

I am trying to handle an event for when a PDF has downloaded and been fully displayed in Internet Explorer.

Which UIAutomation event will handle this?

CJ7
  • 22,579
  • 65
  • 193
  • 321

1 Answers1

-1

If you are referring to the UIAutomation object in the .NET Framework, it supports managed code. Internet Explorer is written in C++ as unmanaged code. Some folks have managed to write extensions using managed code, in spite of clear advice to the contrary, however, I've not heard of anyone successfully controlling IE using managed code.

Earlier versions of IE could be automated using COM interfaces or VBA objects, however, these features have been increasing deprecated over the years.

In addition, few of those interfaces supported extensions. (PDF is not a natively supported file type for Internet Explorer, so automation would depend on the surfaces exposed by the application registered to handle PDF mime types for the individual user.)

Since Edge is now the official browser, it's unlikely that IE will be updated to support managed code extensions. Note that Edge does not currently support extensions and little information is available describing when, or if, that will change. (There have been vague promises in the past, but little additional information.)

If you're trying to accomplish a specific effect, consider posting a more specific question, one showing:

  • The code that you're trying to use,
  • The effect you're trying to achieve, and
  • The behavior you're seeing instead.

Hope this helps...

-- Lance

Lance Leonard
  • 3,285
  • 3
  • 16
  • 15
  • If you had any experience with the `UIAutomation` object you would know it is capable of automating `Internet Explorer`. Why not investigate the subject matter properly before making comments about it? – CJ7 Mar 14 '16 at 22:24
  • Setting aside the snark, which UI Automation object do you refer to? The .NET Framework object linked earlier, the [Accessibility technology](https://msdn.microsoft.com/en-us/library/windows/desktop/ee684009(v=vs.85).aspx), or something else? (Automation of Internet Explorer has certain restrictions, in part to prevent manipulation by the malicious.) – Lance Leonard Mar 14 '16 at 23:11
  • I am talking about `UIAutomation` which has both a `.NET` and `COM` interface, so it doesn't matter which interface is used. This happens to be an example of someone successfully using the `COM` interface to automate Internet Explorer: http://stackoverflow.com/questions/26038165/automate-saveas-dialouge-for-ie9-vba I can confirm this works with IE 11. So it is just plain wrong that `UIAutomation` cannot be used to automate Internet Explorer. – CJ7 Mar 15 '16 at 05:03
  • There is a difference between "supported" and "happens to work." I can tell you that VBA is deprecated for Internet Explorer, meaning it's no longer supported. When this term appears in Microsoft documentation, it has a specific meaning, which essentially translates to "it might work or it might not, but there's no guarantee and you're on your own trying to use it." Also, remember that feature support changes over time. Many legacy supported in legacy versions of Internet Explorer have been deprecated, made obsolete, and removed in [later versions of the browser](http://bit.ly/1Xt7rLZ). – Lance Leonard Mar 15 '16 at 18:09
  • Now, PDF support is not native to IE and is typically handled through a MIME type handler, generally (though not always) defined using the Registry or by installing an add-on. Your original request (essentially) asks which automation event responds to an action in a binary external to IE. Traditionally, IE passes handler requests to the handler defined in the registry, which is responsible for handling it. If an error is returned, that can be surfaced, but that depends on the actual version of IE and the OS. (Rules change over time). – Lance Leonard Mar 15 '16 at 18:15
  • Perhaps the best approach would be to create a tracer app, one that hooks notifications into the exposed events you're aware of and see what fires in your scenario. If you're not able to detect the event you're looking for, it's entirely possible that there's no such event. In that case, you would need to determine a different way to achieve your overall result. (Perhaps using JavaScript to adjust a control object that you can detect.) – Lance Leonard Mar 15 '16 at 18:19
  • There is not, to my knowledge, an official, current reference of automation events for IE11 or any recent version of IE. Related information in the documentation set is generally dated and has (likely) not been updated to reflected recent security changes to the OS (such as AppContainers) or other possible mitigating factors. – Lance Leonard Mar 15 '16 at 18:22