I am using RAD Studio Rio which has support for High DPI.
But it doesn't seem to work on TWebBrowser
, at least not by default like it does on other VCL components.
So when I drag the app from Low-DPI to High-DPI monitor, the user interface and all components resize (including the web browser container), but not the content inside web browser which stays the same.
I am sure it can be enabled, because moving Internet Explorer between monitors does change the content size automatically.
So the question is how to enable it for TWebBrowser
too?
I noticed that when dragging IE window the "Zoom" setting changes automatically (from 100% to 200% - 200% is the DPI scaling value of the High DPI monitor) so it may be done through the use of zoom, or somehow else. But there is also a question of scroll-bar sizes too.
I also noted the existance of DOCHOSTUIFLAG_DPI_AWARE
flag which might be useful but I don't know how to utilize it yet.
EDIT: I've created a IDocHostUIHandler
descendant class which contains GetHostInfo
function where I can control the flags, among others add DOCHOSTUIFLAG_DPI_AWARE
which automatically zooms TWebBrowser to the system DPI (if system DPI is set to 150%, web browser will automatically also zoom to 150%). There is no need to use FEATURE_BROWSER_EMULATION
registry key for this.