It is currently Thu Sep 19, 2019 11:45 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Webgadget IE compatibilty mode
PostPosted: Thu Aug 22, 2013 7:50 am 
Offline
User
User

Joined: Fri Aug 16, 2013 2:52 pm
Posts: 68
Code:
If OpenWindow(0,0,0,800,600,"Webgadget",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
  WebGadget(0,0,0,800,600,"http://whatismybrowser.com/")   
EndIf

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow

Hi everyone,
running the code above gives me the following result:
Quote:
Internet Explorer 10 on Windows 7
Internet Explorer 7 Compatibility View, 32 bit compatibility layer, Media Center PC v6.0

I have two questions about this:
    Can anybody explain me the reason the webgadget is running in IE 7 mode?
    Can this be changed to display modern pages with html5/css3?
Thanks!

_________________
This signature was removed by [removed] for your own safety.


Top
 Profile  
Reply with quote  
 Post subject: Re: Webgadget IE compatibilty mode
PostPosted: Thu Aug 22, 2013 10:23 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Feb 18, 2010 11:10 pm
Posts: 192
Try this:
Code:
RegCreateKeyValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", GetFilePart(ProgramFilename()), "10001", #REG_DWORD, ".")

Possible parameter values - http://msdn.microsoft.com/en-us/library ... 85%29.aspx


Top
 Profile  
Reply with quote  
 Post subject: Re: Webgadget IE compatibilty mode
PostPosted: Thu Aug 22, 2013 11:07 am 
Offline
User
User

Joined: Fri Aug 16, 2013 2:52 pm
Posts: 68
Works perfectly, thanks a lot, also for the link! :)

_________________
This signature was removed by [removed] for your own safety.


Top
 Profile  
Reply with quote  
 Post subject: Re: Webgadget IE compatibilty mode
PostPosted: Sat Aug 31, 2013 1:05 am 
Offline
Enthusiast
Enthusiast

Joined: Sun Jan 11, 2004 11:34 am
Posts: 274
Location: France
Exactly:

See MSDN: http://msdn.microsoft.com/en-us/library ... 30(v=vs.85).aspx

Registry path:
Code:
32 bit:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

Value Key: yourapplication.exe

64 bit:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

Value Key: yourapplication.exe


La valeur associée doit correspondre à ça:
Code:
The value to set this key to is (taken from MSDN here) as decimal values:

10001 (0x2711)
Internet Explorer 10. Webpages are displayed in IE10 Standards mode, regardless of the !DOCTYPE directive.

10000 (0x02710)
Internet Explorer 10. Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode. Default value for Internet Explorer 10.

9999 (0x270F)
Internet Explorer 9. Webpages are displayed in IE9 Standards mode, regardless of the !DOCTYPE directive.

9000 (0x2328)
Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode.

8888 (0x22B8)
Webpages are displayed in IE8 Standards mode, regardless of the !DOCTYPE directive.

8000 (0x1F40)
Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode.

7000 (0x1B58)
Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode.


Top
 Profile  
Reply with quote  
 Post subject: Re: Webgadget IE compatibilty mode
PostPosted: Sat Aug 31, 2013 1:14 am 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5755
Location: Berlin - Germany
the 64-bit Key is only for 32-Bit programs on 64-bit OS, but not for 64-Bit programs on 64-bit OS :wink:

and it is not recommed to use the Wow6432Node-path directly, better use this:
viewtopic.php?p=422572#p422572

_________________
PureBasic 5.71 | SpiderBasic 2.21 | Windows 10 Pro (x64) | Linux Mint 19.2 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Webgadget IE compatibilty mode
PostPosted: Sat Aug 31, 2013 4:45 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Fri Apr 25, 2003 5:24 pm
Posts: 7581
> RegCreateKeyValue("HKEY_LOCAL_MACHINE\Software\ [...]

Don't forget this will need Admin rights to work.

_________________
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.


Top
 Profile  
Reply with quote  
 Post subject: Re: Webgadget IE compatibilty mode
PostPosted: Fri Jan 19, 2018 11:39 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Nov 26, 2015 6:52 pm
Posts: 153
Location: Italy
This thread has been many times a useful reference to me, and helped me overcome the WebGadget limitation of old-browser behaviour, and enjoy some HTML5 in the WebGadget.

I'd like to keep it alive and add a few useful links on the topic, which have helped me further search the subject:


Also worth mentioning, that with RegCreateKeyEx for current user using REG_OPTION_VOLATILE for dwOptions allows to set browser compatiblity mode for the given executable without changing permanently the registry (and should not require high priviledges to run). Furthermore (unlike for local machine), the registry key under current user is the same for both 32 and 64 bit executables! (so no need to worry about bitness of app)

The registry key must be set before opening the WebGadget!


Code:
LONG RegCreateKeyEx(
  HKEY hKey,                                    // handle of an open key 
  LPCTSTR lpSubKey,                             // address of subkey name 
  DWORD Reserved,                               // reserved 
  LPTSTR lpClass,                               // address of class string 
  DWORD dwOptions,                              // special options flag 
  REGSAM samDesired,                            // desired security access 
  LPSECURITY_ATTRIBUTES lpSecurityAttributes,   // address of key security structure 
  PHKEY phkResult,                              // address of buffer for opened handle 
  LPDWORD lpdwDisposition                       // address of disposition value buffer 
);

From MS documentation:

Quote:
dwOptions — Specifies special options for the key. This parameter can be one of the following values:

[...]

REG_OPTION_VOLATILE — Windows NT: This key is volatile; the information is stored in memory and is not preserved when the system is restarted. The RegSaveKey function does not save volatile keys. This flag is ignored if the key already exists.


Nowadays, the ideal value of the compatibility mode is 11001 (aka Edge mode), which will use the highest browser version available on the machine (ie: IE11 on all modern Windows). Other values don't make much sense probably.

_________________
The PureBASIC Archives:
FOSS Resources:


Top
 Profile  
Reply with quote  
 Post subject: Re: Webgadget IE compatibilty mode
PostPosted: Tue Nov 13, 2018 5:41 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1212
Location: germany
Hello Tristano,

do you have a final path for the needed registry entry and, maybe, a PB example about how you set this value?

Thanks!


Top
 Profile  
Reply with quote  
 Post subject: Re: Webgadget IE compatibilty mode
PostPosted: Tue Nov 13, 2018 9:14 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Sep 21, 2007 5:52 am
Posts: 3392
Location: New Zealand
Code:
Procedure SetFeature_Browser_Emulation()
  Protected lpValueName.s,lpData.l,phkResult,lpsdata.s
  lpValueName.s = GetFilePart(ProgramFilename())
  lpData = 11001 
  If RegCreateKeyEx_(#HKEY_CURRENT_USER, "SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", 0, #Null, #REG_OPTION_VOLATILE, #KEY_ALL_ACCESS, #Null, @phkResult, @lpdwDisposition) = #ERROR_SUCCESS
    RegSetValueEx_(phkResult, lpValueName, 0, #REG_DWORD, @lpData, SizeOf(LONG))
    RegCloseKey_(phkResult)
  EndIf
   
EndProcedure

Procedure DelFeature_Browser_Emulation()
  Protected phkResult,lpValueName.s 
  lpValueName.s = GetFilePart(ProgramFilename())
  If RegOpenKeyEx_(#HKEY_CURRENT_USER, "SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", 0, #KEY_SET_VALUE, @phkResult) = #ERROR_SUCCESS
    RegDeleteValue_(phkResult, lpValueName)
    RegCloseKey_(phkResult)
  EndIf
EndProcedure


Top
 Profile  
Reply with quote  
 Post subject: Re: Webgadget IE compatibilty mode
PostPosted: Tue Nov 13, 2018 10:06 pm 
Offline
Addict
Addict

Joined: Mon Feb 16, 2015 2:49 pm
Posts: 1896
This thread should be made Sticky.


Top
 Profile  
Reply with quote  
 Post subject: Re: Webgadget IE compatibilty mode
PostPosted: Wed Nov 14, 2018 9:02 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1212
Location: germany
Hi idle,

thank you very much! Great!

Is there any experience about the reliability of this hack? If I want to roll out such for thousands of users, how big is the chance that other software manipulates the same key at the same time and how often does this happen?

Best,

Kukulkan


Top
 Profile  
Reply with quote  
 Post subject: Re: Webgadget IE compatibilty mode
PostPosted: Wed Nov 14, 2018 9:20 am 
Offline
Addict
Addict

Joined: Mon Feb 16, 2015 2:49 pm
Posts: 1896
Kukulkan wrote:
If I want to roll out such for thousands of users, how big is the chance that other software manipulates the same key at the same time and how often does this happen?

Bisonte answered this exact question for me here:

viewtopic.php?p=528529#p528529

There's no clashing with other software. :)


Top
 Profile  
Reply with quote  
 Post subject: Re: Webgadget IE compatibilty mode
PostPosted: Wed Nov 14, 2018 9:33 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 06, 2005 2:35 pm
Posts: 1212
Location: germany
Great! Thanks! I just checked the code and yes, it enters the executable name. Therefore, it should not apply to others and others should not affect me. Perfect!


Top
 Profile  
Reply with quote  
 Post subject: Re: Webgadget IE compatibilty mode
PostPosted: Wed Nov 14, 2018 9:46 am 
Offline
Addict
Addict
User avatar

Joined: Fri Sep 21, 2007 5:52 am
Posts: 3392
Location: New Zealand
Kukulkan wrote:
Hi idle,

thank you very much! Great!

Is there any experience about the reliability of this hack? If I want to roll out such for thousands of users, how big is the chance that other software manipulates the same key at the same time and how often does this happen?

Best,

Kukulkan


It's the Microsoft official solution, it's not ideal but at least it set your application name, so yes it's safe

Quote:
HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER)
SOFTWARE
Microsoft
Internet Explorer
Main
FeatureControl
FEATURE_BROWSER_EMULATION
YourApplication.exe = (DWORD) 00011001


Top
 Profile  
Reply with quote  
 Post subject: Re: Webgadget IE compatibilty mode
PostPosted: Wed Nov 14, 2018 9:54 am 
Offline
Addict
Addict

Joined: Mon Feb 16, 2015 2:49 pm
Posts: 1896
Kukulkan wrote:
yes, it enters the executable name

Yep. Just don't name your executable "calc.exe" or "notepad.exe" :lol:


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye