0

I've got a Delphi Windows/VCL (XE7) program that embeds CHM help pages in various panels of the program. This largely works fine but the panels always shows an ugly recessed border (looks very windows 95). Here is a screenshot:

enter image description here

Does anyone know how to display the help files with no border? Below is the code I use at the moment. Thanks for any help!

Procedure DoShowEmbeddedHelp(TheWinName: string; ThePanel: TPanel;
  var HelpWinHandle: integer; HelpTopic: string; var LastTopic: string;
  ByContext: boolean; ContextData: integer; var LastContext: integer);

var
  wintypedef: THHWinType;
  hf, fn: string;
begin
  hf := Gl.ProgramPath + 'leap.chm';
  if not FileExists(hf) then
    MessageDlg('Help file not found: ' + hf, mtError, [mbOK], 0)
  else if ((not ByContext) and (HelpTopic <> LastTopic)) or
    (ByContext and (ContextData <> LastContext)) then
   begin
     if not ByContext then
       begin
         LastTopic := HelpTopic;
         LastContext := 0;
       end
      else
        begin
          LastContext := ContextData;
          LastTopic := '';
        end;
      fn := hf + '>' + TheWinName;
      FillChar(wintypedef, sizeof(wintypedef), 0);

      with wintypedef do
        begin
          cbStruct := sizeof(wintypedef);      
          fUniCodeStrings := false;        
          pszType := PAnsiChar(TheWinName); 
          fsValidMembers := 
            HHWIN_PARAM_PROPERTIES or 
            HHWIN_PARAM_STYLES or 
            HHWIN_PARAM_EXSTYLES or 
            HHWIN_PARAM_RECT or 
            HHWIN_PARAM_NAV_WIDTH or 
            HHWIN_PARAM_SHOWSTATE or 
            HHWIN_PARAM_TB_FLAGS or 
            HHWIN_PARAM_EXPANSION; 

          fsWinProperties :=
            HHWIN_PROP_NOTITLEBAR or 
            HHWIN_PROP_NO_TOOLBAR or HHWIN_PROP_NODEF_STYLES or
            HHWIN_PROP_NODEF_EXSTYLES or
            HHWIN_PROP_TRI_PANE; 

      wintypedef.pszCaption := ''; 
      wintypedef.dwStyles := WS_VISIBLE or WS_CHILDWINDOW;
      wintypedef.dwExStyles := WS_EX_LEFT; 
      wintypedef.rcWindowPos := Rect(0, 0, ThePanel.ClientWidth, ThePanel.ClientHeight);
      wintypedef.nShowState := SW_SHOW; 
      wintypedef.fsToolBarFlags := HHWIN_BUTTON_PRINT or HHWIN_BUTTON_BACK;
      fNotExpanded := true;
    end;

  if integer(HtmlHelp(0, nil, HH_SET_WIN_TYPE, DWORD(@wintypedef))) < 0 then
    ShowMessage('Help failed on topic: ' + HelpTopic)
  else if ByContext then
    HelpWinHandle := HtmlHelp(ThePanel.Handle, PChar(fn), HH_HELP_CONTEXT, ContextData)
  else
    HelpWinHandle := HtmlHelp(ThePanel.Handle, PChar(fn), HH_DISPLAY_TOPIC, DWORD(PChar('Expressions\' + HelpTopic + '.htm')));
    end;
 end;
CHEAPS
  • 179
  • 3
  • 13
  • Do you have the comctl32 v6 manifest? – David Heffernan Jan 23 '15 at 17:41
  • No - in fact I don't even know what this is (sorry for lack of expertise). Can you tell me more? (I DO vaguely know what a manifest file is). Can you tell me where I can get it and how to apply it? – CHEAPS Jan 23 '15 at 17:46
  • Have you enabled runtime themes? Also, what's that page control like control that we can see? – David Heffernan Jan 23 '15 at 17:48
  • No - I don't think I use themes. The control I am using is a TRZPageControl (part of Raize components). But I get the same recessed border even I just embed the help files in in a plain panel. – CHEAPS Jan 23 '15 at 17:53
  • So your entire app looks old style then? – David Heffernan Jan 23 '15 at 17:58
  • No - I do have a manifest for the program itself. The rest of the program is fine. Its just the one panel with the help page. – CHEAPS Jan 23 '15 at 18:24
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/69472/discussion-between-cheaps-and-david-heffernan). – CHEAPS Jan 23 '15 at 19:01
  • Hello - still looking for help with this. – CHEAPS Feb 20 '15 at 00:26

0 Answers0