Contents of CHM looks weird when using Delphi 10.3 skins

This section is for programmers. Please use it for all discussons on interfacing help with your applications and related subjects.

Moderators: Alexander Halser, Michael Schwarzl

Contents of CHM looks weird when using Delphi 10.3 skins

Unread postby Olivier Beltrami » Wed Jan 30, 2019 8:00 pm

2019-01-30_19-51-03.png
Hi,

I wonder if anyone experienced the issue I am encountering.

I have added the windows 10 Slate skin to my Delphi 10.3 app bu now when I call the CHM help, the contents tree is all black, until I click on each element, one by one (see attached image). Has anyone encountered this issue ?

Very best regards,

Olivier
You do not have the required permissions to view the files attached to this post. This may mean that you can't view them at all, or it may just mean that you need to log into the forum to view them.
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data
User avatar
Olivier Beltrami
 
Posts: 270
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France

Re: Contents of CHM looks weird when using Delphi 10.3 skins

Unread postby Alexander Halser » Thu Jan 31, 2019 11:39 am

Hi Olivier,

I am not sure about the 10.3 skins in Delphi and how they work. I haven't seen this problem with Developer Express skins, for instance. But I know of other 3rd party skins that influence the UI of the help window, if invoked. It most probably has to do with the way the help file gets invoked.

The standard way in Delphi is to include the unit HtmlHelpViewer into the uses clause and use the TApplication help calls to display help. Example:
Code: Select all
Application.Helpfile := 'c:\mypath\myhelpfile.chm';
Application.HelpShowTableOfContents;


This results in the HtmlHelp() call that uses the application handle as the first parameter and subsequently makes the help window a child of the application. Here's probably the source of the problem: depending on how the skin works in the background, it probably tries to skin the help window as well, though it is not a Delphi form.

Try to make a direct call to HtmlHelp() from your application and see if this makes a difference:

Code: Select all
var
  tmphelpcall: String;
begin
  application.Helpfile := 'c:\mypath\myhelpfile.chm';

  if MyTopicID <> '' then
    tmphelpcall := Format('%s::/%s', [Application.HelpFile, changeFileExt(MyTopicID, '.htm')])
  else
    tmphelpcall := Application.HelpFile;

  HtmlHelp(0, pchar(tmphelpcall), HH_DISPLAY_TOPIC, 0);  // <= this is the direct call of the HTML Help API
Alexander Halser
Senior Software Architect, EC Software GmbH
User avatar
Alexander Halser
EC-Software Support
 
Posts: 3933
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria

Re: Contents of CHM looks weird when using Delphi 10.3 skins

Unread postby Olivier Beltrami » Thu Jan 31, 2019 11:47 am

Thank you very much, Alexander.
I will try your suggestion and let ou know how it turns out.
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data
User avatar
Olivier Beltrami
 
Posts: 270
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France

Re: Contents of CHM looks weird when using Delphi 10.3 skins

Unread postby Olivier Beltrami » Thu Jan 31, 2019 12:04 pm

Hello again,

It turns out that, almost everywhere in my app, I had been making direct calls to HtmlHelp() for over 10 years, probably due to some other issue I had encountered. But this case was help called from a special button component that I designed in 2002, and which still used Application.HelpContext(). Changed the code of that component to also use HtmlHelp() and the problem is gone :-)

Thank you very much !

Olivier
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data
User avatar
Olivier Beltrami
 
Posts: 270
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France


Return to Programmers' Corner

Who is online

Users browsing this forum: Google [Bot] and 1 guest