05-14-2018, 03:48 AM
Function WebBrowserControlDisableIE7Emulation
;/
function [flags] ;;flags: 1 for all users
;Ensures that web browser controls of this program (qm.exe or qmmacro.exe or your QM-created exe) can use features of current Internet Explorer version (CSS3, HTML5 etc).
;REMARKS
;By default, web browser controls work in compatibility mode with Internet Explorer 7. IE 8/9/10/11 features are unavailable.
;This function sets this registry value, if it is missing or different:
;;;SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION:<ThisProgram.exe>=<CurrentInternetExplorerVersion>
;By default sets its only for current user, in HKEY_CURRENT_USER. If flag 1, sets for all users, in HKEY_LOCAL_MACHINE; then error if this process is not running as administrator.
;You can call this function before ShowDialog if the dialog contains an ActiveX control SHDocVw.WebBrowser. Or call it once.
if(_iever<8) ret
str e.getfilename(ExeFullPath 1)
;out e
int t v=_iever>>8*1000
;out v
int h=iif(flags&1 HKEY_LOCAL_MACHINE HKEY_CURRENT_USER)
lpstr k="SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION"
if(rget(t e k h) and t=v) ret
;out t
if(!rset(v e k h)) end ERR_ADMIN