Einzelnen Beitrag anzeigen

CCRDude

Registriert seit: 9. Jun 2011
678 Beiträge
 
FreePascal / Lazarus
 
#12

AW: CHM-Datei im eigenen Formular anzeigen

  Alt 13. Sep 2012, 09:12
Ok, mit der Methode von EWeiss geht es auch Nur auch WS_SIZEBOX ausschließen... in meiner Beispiel-Unit sähe die Methode RefreshChildHandles dann so aus:

Delphi-Quellcode:
procedure THTMLHelpViewerHelper.RefreshChildHandles;
var
   rClient, rWindow: TRect;
   iFrameWidth, iFrameHeight: integer;
   iStyle: integer;
begin
   if FMainWindowHandle > 0 then begin
      case FMethod of
         rpmMain: begin
               // get window dimensions to hide frame
               FMainWindowDiff.Left := 0;
               FMainWindowDiff.Right := 0;
               FMainWindowDiff.Top := 0;
               FMainWindowDiff.Bottom := 0;
               iStyle := GetWindowLong(FMainWindowHandle, GWL_STYLE);
               iStyle := iStyle and (not WS_BORDER) and (not WS_SIZEBOX);
               SetWindowLong(FMainWindowHandle, GWL_STYLE, iStyle);
               Windows.SetParent(FMainWindowHandle, FControl.Handle);
            end;
         rpmChilds: begin
               // we're resizing this to have e.g. toolbar wrapped according to target size
               Windows.SetWindowPos(FMainWindowHandle, 0, 0, 0, FControl.ClientWidth, FControl.ClientHeight, 0);
               // need to hide since it won't contain any further controls
               Windows.ShowWindow(FMainWindowHandle, SW_HIDE);
               // TODO : we need to change message loops etc. for this to work!
                // now moving all childs
               EnumChildWindows(FMainWindowHandle, @HelpWindowChildsEnum, integer(Self));
            end;
      end;
      ReAlign;
   end;
end;
  Mit Zitat antworten Zitat