Windows 10, IE Web Browser Control, and FEATURE_BROWSER_EMULATION

I’ve got a Visual FoxPro app that uses the Microsoft Web Browser ActiveX control as the primary UI.

A few years ago, I needed to “upgrade” the pages being rendered by the Web Browser Control to a more modern look and feel (think HTML5), and found that many of the changes I had made simply weren’t working – all thanks to the Web Browser Control using IE7 rendering mode.

That’s when I discovered the FEATURE_BROWSER_EMULATION registry key (thanks to Rick Strahl).  Rick has written about this key several times on his blog:

Web Browser Control – Specifying the IE Version (May 11, 2011 – Updated 7/19/2014)

Make Your CHM Help Files Show HTML5 and CSS3 Content (February 15, 2012)

HTML5 and CSS3 Editing in Windows Live Writer (July 8, 2013)

After reading Rick’s original post, I took the “clever” way out by adding the registry key to my InnoSetup script, and setting the Value of the key to zero (0).  Setting the key to zero tells the Web Browser Control to render pages using the currently installed version of IE on the users computer.

This has worked well for me the past couple of years.

Until this weekend.

On Saturday, I updated my Windows 10 virtual machine to Build 10130, and started up my app.

The app loaded fine, but instead of rendering the “home” page as it should, there was nothing but a blank white area where the Web Browser Control sits.  Even worse, when I closed the app, the EXE continued running in Windows Task Manager.  This is a problem, since I prevent more than one instance of the app from running on a machine.  Double-clicking the icon to start the app again did nothing, as the EXE was still running – but was invisible.

After trying several different things to get the page to load, I finally removed the registry key for FEATURE_BROSWER_EMULATION for the application EXE – I restarted the app, and it rendered the pages perfectly.

I’ve jumped through several different values for the registry key, and it seems no matter which value I choose the Web Browser Control (in Windows 10 Build 10130) renders the pages based on the version of Internet Explorer that is installed (in my case, IE 11).

This piqued my curiosity for other versions of Windows, and it appears I can set the decimal value for FEATURE_BROWSER_EMULATION to 11000 (IE11 Standards mode) for all OSes from XP forward to ensure the Web Browser Control will render pages based on the version of Internet Explorer that is installed.  In Windows XP (which can only go to IE8, the pages rendered as I expected them to render for IE8).

 

 

 

I Need Some SUBSTR() Help, Please!

Last week, I presented a session titled, “Unicode Made Easier with SQLite” at the Southwest Fox 2014 conference.

At the end of the session, an attendee asked about manipulating strings, specifically using SUBSTR() on UTF-8 encoded strings.

Last night, I played around with creating my own SUBSTR() function to deal with UTF-8 encoded strings, and I think I may have been successful, but I’m not sure.

If there are any readers that can tell me if the image below looks correct for a SUBSTR(2,3) on the Russian phrase in the textbox, I would appreciate it very much.

On the other hand, if you think I’m going down a rabbit hole that doesn’t need to be traveled, please let me know.  I would hate to think I’ve wasted time “substringing” a phrase for which there is really no need for “substringing.”

Thank you in advance for any help!

Image of substr example

SUBSTR() on UTF-8 data

Have You Seen My Segoe?

I was going to do a post about subclassing the Visual FoxPro Label base class, when I ran across a strange thing in my VFP IDE using Windows 8: “Segoe UI” is missing from the FontName dropdown in the VFP Properties window.

I have a form I created when I was using Windows 7. I had set my labels to use the “Segoe UI” 9pt font on the form.

When I opened the form with Windows 8, strange things started happening. When I clicked on the FontName property in the Properties window, the dropdown changed to an empty value. I clicked the dropdown and scrolled down to the Segoe fonts.

“Segoe UI” was GONE!

Even stranger, when I went back to the form and clicked on a label (while the FontName property was still selected in the Properties window), the label font changed to MS Sans Serif, the FontName property changed to [None], and the dropdown remained empty!

I ended up selecting “Segoe UI Symbol” from the Property window dropdown for FontName. It was the closest to “Segoe UI” I could find.

Has anyone else noticed this? Is it my machine? My VFP configuration? For what it’s worth, “Segoe UI” is installed on my system, and it also appears in the array created by AFONT().

Here’s a brief (2 minute) video I made showing the behavior. When I reference “AFONTS()” in the video, I meant “AFONT()”.