When I was developing my self-support Windows and Mac native applications, I wanted to have a common user interface for both operating systems. I could have used Qt but I wasn't convinced this was the route to take. In the end I chose to use an embedded browser with an HTML / JavaScript user interface.

With security in mind, I didn't want the user interface code to be plain for all to see, so I decided to place it in an encrypted file which would be loaded by the application at startup and decrypted on-the-fly based upon the HTTP request.

This is a fairly complicated process, particularly with Windows, so I will break the solution down into several posts, with this one showing how to embed a browser into a Windows native application. I notice that things have moved on since I developed my original code, with Microsoft now offering a choice of embedding Internet Explorer or Edge. Unfortunately, Microsoft decided to add Edge via a new API rather than supporting it under the existing Internet Explorer API. So, this post will cover how to deal with both.

I have uploaded the code to GitHub and to be synchronised with this post you should execute a git checkout to the PART_1 tag. You'll need to get this code otherwise the remainder of this post will not make much sense.

Microsoft Visual Studio 2019 Community Edition was used to develop this example.