I don't think htmlfile
is intended to be used as a GUI control.
Try using a WebBrowser
control instead, i.e. Shell.Explorer
. Just keep in mind that it returns a WebBrowser object, not a document object. The WebBrowser object has a .Document
If you don't want to be restricted to IE7 compatibility mode (which is the default for WebBrowser controls and most likely htmlfile
), you should use something like this:
Code: Select all
Gui, Add, ActiveX, x0 y-5 w140 h50 vWB, about:<!DOCTYPE html><meta http-equiv="X-UA-Compatible" content="IE=edge">
I do not know whether that will solve your problem.
If the registration of the HTMLFile
ProgID or the about
protocol is corrupt, the respective method won't work. Some antivirus (I forget which) actually replace one or all of those with their own "proxy" class, for whatever reason. I have come across a computer from which that antivirus had been uninstalled improperly and other software which relied on the WebBrowser control ceased to function. IIRC, the usual methods of repairing IE were insufficient and I had to manually correct registry entries which were referencing non-existent dlls (belonging to the antivirus).
This will do some basic checks:
Code: Select all
keys := [["HKCR\htmlfile\CLSID"],["HKCR\Shell.Explorer\CLSID"]
for i, key in keys
RegRead CLSID, % key, % key
RegRead dll, HKCR\CLSID\%CLSID%\InProcServer32
MsgBox % key ":`n" dll
It should show mshtml.dll or ieframe.dll. The registration can differ between 32-bit and 64-bit; this will only check the registration relevant to whichever AutoHotkey.exe you are using. There are probably many other ways that IE can become corrupt.