Answered by:
How to adapt dpi in iWebbrowser or CHtmlView?

Question
-
Our application is marked as DPI aware , there is a dialog,embedded a web browser control (CHtmlView), for showing url.
but it show unnormal in high dpi mode or in 4k device.
reference :
http://stackoverflow.com/questions/15781260/what-does-the-zoom-factor-mean-in-olecmdid-optical-zoom
it mentioned there is a flag
DOCHOSTUIFLAG_DPI_AWARE
controlling the High DPI behaviour of the web control.DOCHOSTUIFLAG_DPI_AWARE
Internet Explorer 8. Causes layout engine to calculate document pixels as 96 dpi. Normally, a document pixel is the same size as a screen pixel. This flag is equivalent to setting the FEATURE_96DPI_PIXEL feature control key on a per-host basis.it confuses me if the flag affect the webbrowser control behavior in ie 10 or ie11 by the bellow link reg
https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/general-info/ee330730(v=vs.85)?redirectedfrom=MSDN
or
Is there a better way to support high dpi in web browser(CHtmlView)??
- Moved by Jeanine ZhangMicrosoft contingent staff Wednesday, April 22, 2020 7:32 AM
Tuesday, April 7, 2020 6:38 AM
Answers
-
- Proposed as answer by Richard MuellerMVP Wednesday, April 22, 2020 1:30 PM
- Marked as answer by Dave PatrickMVP Wednesday, April 29, 2020 2:37 PM
Wednesday, April 22, 2020 12:11 PM
All replies
-
Hi,
Thank you for posting here.
>>How to adapt dpi in iWebbrowser or CHtmlView?
As far as I'm concerned, Browser control uses old version of IE engine by default. I suggest you could try to set feature control registry key FEATURE_BROWSER_EMULATION to use newer version of IE.
For more details I suggest you could refer to the link: https://stackoverflow.com/a/53541159/11872808
Best Regards,
Jeanine Zhang
Wednesday, April 8, 2020 1:51 AM -
Thanks!
the registry key FEATURE_BROWSER_EMULATION has been set newer version of IE(IE 11).
i am not sure that does the flag
DOCHOSTUIFLAG_DPI_AWARE affect the ie11
behavior ?Wednesday, April 8, 2020 2:20 AM -
Hi,
As far as I'm concerned, that the issue is become from your web page, not from iWebbrowser or CHtmlView.
When you run Internet Explorer 11 on a computer such as a Surface Book or a Surface Pro 4 that has a high-resolution display, the user interface and fonts may be displayed in different sizes when you move a browser window between the built-in display and a lower resolution external monitor.
For more details about the solution of the issue, I suggest you could refer to the link: https://support.microsoft.com/en-us/help/3165808/internet-explorer-11-window-display-changes-between-a-built-in-device
Best Regards,
Jeanine Zhang
Thursday, April 9, 2020 5:43 AM -
hi, Our application is marked as DPI aware, there is a dialog, embedded a web browser control (CHtmlView);
add FEATURE_SYSTEM_DPI_AWARE reg does not work!
Friday, April 10, 2020 1:55 AM -
Hi,
Regarding this issue that DOHCOSTUIFLAG_DPI_AWARE affects the behavior of ie11, since this issue is not related to c++ or MFC. It is likely that this issue is beyond our support.I will move it to Where is the Forum For…? forum to redirect it to the correct forum.
Best Regards,
Jeanine Zhang
Wednesday, April 22, 2020 7:32 AM -
Hello,
does this post help you already? https://stackoverflow.com/questions/45955977/web-pages-in-chtmlview-with-high-dpi-150-display-incorrectly
If not, you could ask here:
https://stackoverflow.com/questions/tagged/internet-explorer
- Proposed as answer by Richard MuellerMVP Wednesday, April 22, 2020 1:30 PM
Wednesday, April 22, 2020 8:00 AM -
- Proposed as answer by Richard MuellerMVP Wednesday, April 22, 2020 1:30 PM
- Marked as answer by Dave PatrickMVP Wednesday, April 29, 2020 2:37 PM
Wednesday, April 22, 2020 12:11 PM