Create a web-style graphical user interface in the MFC programming (1)

xiaoxiao2021-03-31  211

The introduction of the article This article will introduce you how to create a web-style graphical user interface in a program written in MFC. Here I've described "Application With Web-Style GUI" means that all or part of the user interface is HTML format. The following picture shows us a web-style session window.

When I try to use this web type user interface in the program, I will face the following two questions:

1. How to handle events and messages in the web interface (ie intercepting events on the DHTML interface and processed by the background program)

2, how to make the background program interact with the elements of the web interface (ie the background program can modify and refresh against DHTML)

In order to solve these two tricky problems, MSDN gives us the recommendation to use DHTML COM components. But I think this is not a good idea. Especially for simple MFC user interface mode, this mode is mapped to the control class for processing.

So I wrote this article to explain how to create a web-style user interface and work with the program background with the program background. Summary is:

◎ Use the onbeforenavigate2 () to receive the event of the web interface.

◎ Implement the interaction between the interface and the background program by adding the corresponding script function in the code of HTML.

In this article, I will also introduce three classes: chtmldialog, chtmlscript, chtmlctrl, and how to create web-style user interfaces.

转载请注明原文地址:https://www.9cbs.com/read-130828.html

New Post(0)