{"id":1999,"date":"2014-05-01T19:41:58","date_gmt":"2014-05-02T00:41:58","guid":{"rendered":"http:\/\/www.wiredprairie.us\/blog\/?p=1999"},"modified":"2014-05-01T19:41:58","modified_gmt":"2014-05-02T00:41:58","slug":"ihtmldocument5-and-ihtmldocument6-in-c","status":"publish","type":"post","link":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1999","title":{"rendered":"IHTMLDocument5 and IHTMLDocument6 in C#"},"content":{"rendered":"
Unexpectedly, I found myself needing to use IHTMLDocument5\/6 last evening to fetch a few properties that aren\u2019t directly exposed via any of the Web Browser options in classic .NET programming (like WinForms\/WPF). I couldn\u2019t find them anywhere, so I whipped up something simple\/quick\/dirty:<\/p>\n
[Guid("3050f80c-98b5-11cf-bb82-00aa00bdce0b"<\/span>)]\n[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]\ninternal<\/span> interface<\/span> IHTMLDocument5\n{\n void<\/span> SetOnmousewheel(object<\/span> p);\n object<\/span> GetOnmousewheel();\n object<\/span> docType { get; }\n object<\/span> implementation { get; }\n object<\/span> createAttribute([In] string<\/span> attrName);\n object<\/span> createComment([In] string<\/span> comment);\n void<\/span> SetOnfocusin(object<\/span> p);\n object<\/span> GetOnfocusin();\n void<\/span> SetOnfocusout(object<\/span> p);\n object<\/span> GetOnfocusout();\n void<\/span> SetOnactivate(object<\/span> p);\n object<\/span> GetOnactivate();\n void<\/span> SetOndeactivate(object<\/span> p);\n object<\/span> GetOndeactivate();\n void<\/span> SetOnbeforeactivate(object<\/span> p);\n object<\/span> GetOnbeforeactivate();\n void<\/span> SetOnbeforedeactivate(object<\/span> p);\n object<\/span> GetOnbeforedeactivate();\n string<\/span> compatMode { get; }\n}\n\n\n[Guid("30510417-98b5-11cf-bb82-00aa00bdce0b"<\/span>)]\n[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]\ninternal<\/span> interface<\/span> IHTMLDocument6\n{\n object<\/span> compatible { get; }\n object<\/span> documentMode { get; }\n void<\/span> SetOnStorage([In] object<\/span> p);\n object<\/span> GetOnStorage();\n void<\/span> SetOnStorageCommit([In] object<\/span> p);\n object<\/span> GetOnStorageCommit();\n object<\/span> getElementById([In] string<\/span> id);\n void<\/span> updateSettings();\n}<\/pre>\n