#19200: chm help file doesn't support hdpi when using hh.exe on Windows

61 views
Skip to first unread message

wxTrac

unread,
Jun 16, 2021, 4:45:53 AM6/16/21
to wx-...@googlegroups.com
#19200: chm help file doesn't support hdpi when using hh.exe on Windows
---------------------------+-------------------------
Reporter: followait | Owner:
Type: optimization | Status: new
Priority: normal | Milestone:
Component: documentation | Version: dev-latest
Keywords: | Blocked By:
Blocking: | Patch: 0
---------------------------+-------------------------
e.g. with a 4K 27' monitor scaled at 200%, the font size are very small.
It's because the manifest of hh.exe doesn't support hdpi.
One solution is to use 3rd-party chm viewer like '''KchmViewer''',
but the experience is not good as the native chm viewer, i.e.
'''hh.exe'''.
Here is a solution:

{{{
mt.exe -manifest "path\to\hh.exe.manifest"
-outputresource:"path\to\hh.exe"
}}}

Where '''hh.exe.manifest''' is as below

{{{
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Copyright (c) Microsoft Corporation -->
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"
manifestVersion="1.0"
>
<assemblyIdentity
version="5.1.0.0"
processorArchitecture="amd64"
name="Microsoft.Windows.Help.HH"
type="win32"
/>
<description>Microsoft HTML Help Executable</description>

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"
/>
</requestedPrivileges>
</security>
</trustInfo>
<asmv3:application>
<asmv3:windowsSettings
xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">
<gdiScaling>true</gdiScaling>
<dpiAware
xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
<dpiAwareness
xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
}}}

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19200>

wxTrac

unread,
Jun 16, 2021, 6:06:57 AM6/16/21
to wx-...@googlegroups.com
#19200: chm help file doesn't support hdpi when using hh.exe on Windows
----------------------------+------------------------
Reporter: followait | Owner:
Type: optimization | Status: new
Priority: normal | Milestone:
Component: documentation | Version: dev-latest
Resolution: | Keywords:
Blocked By: | Blocking:
Patch: 0 |
----------------------------+------------------------
Changes (by pb101):

* cc: pbfordev@… (added)


Comment:

Based on the ticket description (and contrary to the ticket title), this
is obviously not a wxWidgets issue (with generated help file).

The problem seems to be with Microsoft's HTML Help Viewer allegedly not
properly supporting high DPI, so why create a wxTrac ticket for it?

What exactly do you expect wxWidgets developer team to do with this
application manifest?

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19200#comment:1>

wxTrac

unread,
Jun 16, 2021, 7:15:42 AM6/16/21
to wx-...@googlegroups.com
#19200: chm help file doesn't support hdpi when using hh.exe on Windows
----------------------------+------------------------
Reporter: followait | Owner:
Type: optimization | Status: new
Priority: normal | Milestone:
Component: documentation | Version: dev-latest
Resolution: | Keywords:
Blocked By: | Blocking:
Patch: 0 |
----------------------------+------------------------
Changes (by followait):

* cc: followait@… (added)


Comment:

Replying to [comment:1 pb101]:
> Based on the ticket description (and contrary to the ticket title), this
is obviously not a wxWidgets issue (with generated help file).
>
> The problem seems to be with Microsoft's HTML Help Viewer allegedly not
properly supporting high DPI, so why create a wxTrac ticket for it?

Yes, but it influence the experience of wx developers on Windows, it M$
doesn't fix it, wx may fix it.

> What exactly do you expect wxWidgets developer team to do with this
application manifest?

Like python installer, it gives an option to make upport long path on
Windows at the installation. Because document is very import, a good
experience for viewing chm is very important, and in my experience a fixed
'''hh.exe''' is the best choice on Windows. If CMake can give a warning
and some suggestion about this, I think a wx developer on Windows (with
hdpi monitor) will 100% agree it.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19200#comment:2>

wxTrac

unread,
Jun 16, 2021, 7:18:49 AM6/16/21
to wx-...@googlegroups.com
#19200: chm help file doesn't support hdpi when using hh.exe on Windows
----------------------------+------------------------
Reporter: followait | Owner:
Type: optimization | Status: closed
Priority: normal | Milestone:
Component: documentation | Version: dev-latest
Resolution: wontfix | Keywords:
Blocked By: | Blocking:
Patch: 0 |
----------------------------+------------------------
Changes (by vadz):

* status: new => closed
* resolution: => wontfix


Comment:

Sorry, I really don't think we should mess with hh.exe. Downloading HTML
documentation and using a browser is a better and simpler workaround IMO
and I think we should stop providing CHM after 3.2.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19200#comment:3>

wxTrac

unread,
Jun 16, 2021, 7:20:54 AM6/16/21
to wx-...@googlegroups.com
#19200: chm help file doesn't support hdpi when using hh.exe on Windows
----------------------------+------------------------
Reporter: followait | Owner:
Type: optimization | Status: closed
Priority: normal | Milestone:
Component: documentation | Version: dev-latest
Resolution: wontfix | Keywords:
Blocked By: | Blocking:
Patch: 0 |
----------------------------+------------------------
Changes (by followait):

* cc: followait@… (removed)


Comment:

Replying to [comment:3 vadz]:
> Sorry, I really don't think we should mess with hh.exe. Downloading HTML
documentation and using a browser is a better and simpler workaround IMO
and I think we should stop providing CHM after 3.2.

Html doesn't support index.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19200#comment:4>

wxTrac

unread,
Jun 16, 2021, 7:23:33 AM6/16/21
to wx-...@googlegroups.com
#19200: chm help file doesn't support hdpi when using hh.exe on Windows
----------------------------+------------------------
Reporter: followait | Owner:
Type: optimization | Status: closed
Priority: normal | Milestone:
Component: documentation | Version: dev-latest
Resolution: wontfix | Keywords:
Blocked By: | Blocking:
Patch: 0 |
----------------------------+------------------------

Comment (by vadz):

There is https://docs.wxwidgets.org/3.1.5/classes.html and search in HTML
documentation, I think it's good enough.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19200#comment:5>

wxTrac

unread,
Jun 16, 2021, 7:29:30 AM6/16/21
to wx-...@googlegroups.com
#19200: chm help file doesn't support hdpi when using hh.exe on Windows
----------------------------+------------------------
Reporter: followait | Owner:
Type: optimization | Status: closed
Priority: normal | Milestone:
Component: documentation | Version: dev-latest
Resolution: wontfix | Keywords:
Blocked By: | Blocking:
Patch: 0 |
----------------------------+------------------------
Changes (by followait):

* cc: followait@… (added)


Comment:

Replying to [comment:5 vadz]:
> There is https://docs.wxwidgets.org/3.1.5/classes.html and search in
HTML documentation, I think it's good enough.

No auto completion

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19200#comment:6>

wxTrac

unread,
Jun 16, 2021, 7:34:53 AM6/16/21
to wx-...@googlegroups.com
#19200: chm help file doesn't support hdpi when using hh.exe on Windows
----------------------------+------------------------
Reporter: followait | Owner:
Type: optimization | Status: closed
Priority: normal | Milestone:
Component: documentation | Version: dev-latest
Resolution: wontfix | Keywords:
Blocked By: | Blocking:
Patch: 0 |
----------------------------+------------------------

Comment (by vadz):

Replying to [comment:6 followait]:
> Replying to [comment:5 vadz]:
> > There is https://docs.wxwidgets.org/3.1.5/classes.html and search in
HTML documentation, I think it's good enough.
>
> No auto completion

I'm sure this could be implemented for the search field with a bit of
custom JS. Implementing this would be nice and such improvement would be
very welcome.

> As an example, M$ removes a lot of documents for C/C++ from local help
viewer, and make it available
> online only, because M$ is going to put C/C++ down. For C#, the
document is very well supported locally.

This seems completely off-topic, we're not responsible for what Microsoft
does or does not (I also think that you're quite wrong about putting C++
down but, again, this is not really related to wx at all).

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19200#comment:7>

wxTrac

unread,
Jun 16, 2021, 7:58:45 AM6/16/21
to wx-...@googlegroups.com
#19200: chm help file doesn't support hdpi when using hh.exe on Windows
----------------------------+------------------------
Reporter: followait | Owner:
Type: optimization | Status: closed
Priority: normal | Milestone:
Component: documentation | Version: dev-latest
Resolution: wontfix | Keywords:
Blocked By: | Blocking:
Patch: 0 |
----------------------------+------------------------
Changes (by followait):

* cc: followait@… (removed)


Comment:

Replying to [comment:7 vadz]:
> >
> > No auto completion
>
> I'm sure this could be implemented for the search field with a bit of
custom JS. Implementing this would be nice and such improvement would be
very welcome.

It's welcome.

> > As an example, M$ removes a lot of documents for C/C++ from local help
viewer, and make it available
> > online only, because M$ is going to put C/C++ down. For C#, the
document is very well supported locally.
>
> This seems completely off-topic, we're not responsible for what
Microsoft does or does not (I also think that you're quite wrong about
putting C++ down but, again, this is not really related to wx at all).

To be focus on document, a user will never refuse a better document
system, https://docs.wxwidgets.org/3.1.5/classes.html is enough, but could
be better. chm maybe out of date, M$'s and Qt's help viewers both have
better experience, though they are for their own IDEs.

BTW, in the long term, I think the better the user experience, the more
populer the lib, and more contributions naturally.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19200#comment:8>

David Connet

unread,
Jun 16, 2021, 9:11:19 AM6/16/21
to wx-...@googlegroups.com
On 6/16/2021 4:18 AM, wxTrac wrote:
> and I think we should stop providing CHM after 3.2

Please at least leave the ability to generate it in! I find having a
single file a very convenient thing.

(And I did that manifest hack on my hh.exe as soon as I got my first 4K
monitor. Along with numerous other programs...  Except I set dpiAware as
none - because it's not aware.)

Dave

rohit agarwal

unread,
Jun 16, 2021, 10:42:47 AM6/16/21
to wx-...@googlegroups.com
dpi awareness is something that the platform (MacOS/Win/Unix) could provide but does not.
While you can get from wxSystemSettings::GetMetrics
things like screen resolution in pixels
you cant get diagonal screen size in inches, or anything physical.
If you could, then you could have DPI awareness.
Otherwise, you have to ask the user somehow.
Hence, I don’t think this lies under the purview of wx
> --
> You received this message because you are subscribed to the Google Groups "wx-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wx-dev+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/wx-dev/063.bdbdfcb4963450a4531cae86a94c30fc%40wxwiki.org.

wxTrac

unread,
Jun 16, 2021, 1:12:13 PM6/16/21
to wx-...@googlegroups.com
#19200: chm help file doesn't support hdpi when using hh.exe on Windows
----------------------------+------------------------
Reporter: followait | Owner:
Type: optimization | Status: closed
Priority: normal | Milestone:
Component: documentation | Version: dev-latest
Resolution: wontfix | Keywords:
Blocked By: | Blocking:
Patch: 0 |
----------------------------+------------------------
Changes (by pb101):

* cc: pbfordev@… (removed)


Comment:

Replying to [comment:2 followait]:
> Replying to [comment:1 pb101]:
> > What exactly do you expect wxWidgets developer team to do with this
application manifest?
>
> Like python installer, it gives an option to support long path on
Windows at the end of installation. Document is very import, a good
experience of reading document is important, and in my experience a fixed
'''hh.exe''' achives the best experience on Windows. If CMake can give a
warning and some suggestion about this, I think a wx developer on Windows
(with hdpi monitor) will 100% agree it.

Firstly, I believe that what Python installer does, i.e., offering to
change a registry setting, is entirely different than modifying and
distributing a proprietary executable. Technical issues aside, I strongly
doubt that would be legal.

Secondly, I do not understand what CMake warning is there, related to this
ticket?

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19200#comment:9>

David Connet

unread,
Jun 16, 2021, 1:34:59 PM6/16/21
to wx-...@googlegroups.com
On 6/16/2021 10:12 AM, wxTrac wrote:
> Technical issues aside, I strongly
> doubt that would be legal.

I just wanted to point out, the easiest way of dealing with these
dpi-unaware binaries is not to modify the exe as that ticket suggests
(as that would invalidate a signing cert!) but to extract the existing
manifest (if it exists), modify it, and place "SomeExeName.exe.manifest"
next to "SomeExeName.exe". Then enable the registry key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide]
"PreferExternalManifest"=dword:00000001

(and re-enable it again after some OS updates)

Dave

(I've actually changed some manifests from saying they support hidpi to
saying "no you don't" because their support is so bad. Yeah, lookin at
you Acrobat!)

wxTrac

unread,
Jun 16, 2021, 3:40:57 PM6/16/21
to wx-...@googlegroups.com
#19200: chm help file doesn't support hdpi when using hh.exe on Windows
----------------------------+------------------------
Reporter: followait | Owner:
Type: optimization | Status: closed
Priority: normal | Milestone:
Component: documentation | Version: dev-latest
Resolution: wontfix | Keywords:
Blocked By: | Blocking:
Patch: 0 |
----------------------------+------------------------
Changes (by followait):

* cc: followait@… (added)


Comment:

Replying to [comment:9 pb101]:
> Firstly, I believe that what Python installer does, i.e., offering to
change a registry setting, is entirely different than modifying and
distributing a proprietary executable. Technical issues aside, I strongly
doubt that would be legal.

A patch, e.g. patch_hh_exe.bat is ok.

> Secondly, I do not understand what CMake warning is there, related to
this ticket?

No suitable position for CMake to warn about this.
However for Windows, an option (e.g. check_ms_chm_viewer_hdpi_support_bug)
can be introduced, though it feels weird, it will help the user of wx on
Windows.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19200#comment:10>
Reply all
Reply to author
Forward
0 new messages