0

I have an application that utilizes a VCL Style and have found that CHM help files do not get styled correctly (among other issues). As a workaround, I created a COM automation server that does not utilize VCL styles and my styled application client app sends the necessary parameters (filename, help command, topic) to the automation server. The automation server (the main window of which is hidden) then calls Hthmlhelp: HtmlHelp(GetDesktopWindow, FName, ACommand, ATopic);

The problem is that the help viewer appears behind the client app if the client app is compiled in release mode. Oddly, the help viewer correctly appears on top of the client app if the client app was compiled in debug mode.

How can I get the help viewer to reliably launch on top of my client app? I of course don't want the help viewer to always stay on top even if the client app is clicked -- I just want the expected behavior that the help viewer is on top until the client app is clicked.

TomT
  • 199
  • 1
  • 1
  • 11
  • Could you add the code you use to call HtmlHelp to your q, please? Also, which Windows and Delphi versions are you using? – MartynA Aug 01 '16 at 17:08
  • Instead of `HtmlHelp(GetDesktopWindow, ...);` try passing your app's main form's handle as a parameter to the automation server and let the automation server pass this handle: `HtmlHelp(MainFormHandle, ...)` – Ondrej Kelle Aug 01 '16 at 17:33
  • @TOndrej the help window still appears behind the main app window. – TomT Aug 01 '16 at 17:44
  • Maybe try `Application.Handle`. – Ondrej Kelle Aug 01 '16 at 18:05

0 Answers0