Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   CHM-Datei im eigenen Formular anzeigen (https://www.delphipraxis.net/170255-chm-datei-im-eigenen-formular-anzeigen.html)

EWeiss 13. Sep 2012 07:59

AW: CHM-Datei im eigenen Formular anzeigen
 
Zitat:

Allerdings sehe ich dann immer noch den Rahmen,
Na ja wenn das alles ist?

Delphi-Quellcode:
Style := Style and not WS_BORDER;


gruss

CCRDude 13. Sep 2012 08:12

AW: CHM-Datei im eigenen Formular anzeigen
 
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;

joehoehal 13. Sep 2012 09:25

AW: CHM-Datei im eigenen Formular anzeigen
 
Ich habe inzwischen eine ganz einfache Lösung gefunden:
  • Hilfe-Fenster nicht direkt im Client-Bereich des Formulars, sondern mit SetWindow / SetWindoPos auf einem Panel anzeigen.
  • Größe und Position des Panels so einstellen, dass der Rahmen des Hilfe-Fensters nicht sichtbar ist. So lässt sich auch das Resizing leicht reakisieren.
Sicher nicht die eleganteste Lösung, aber sie funktioniert und ist für meine Bedürfnisse ausreichend.


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:46 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz