AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi Minimieren eines Fensters (bei MDI anwendung)
Thema durchsuchen
Ansicht
Themen-Optionen

Minimieren eines Fensters (bei MDI anwendung)

Ein Thema von DBman · begonnen am 2. Aug 2003 · letzter Beitrag vom 3. Aug 2003
 
Benutzerbild von APP
APP

Registriert seit: 24. Feb 2003
Ort: Graz (A)
705 Beiträge
 
Delphi 7 Enterprise
 
#3

Re: Minimieren eines Fensters (bei MDI anwendung)

  Alt 2. Aug 2003, 20:16
Hallo,
kopiere folgenden Code in einen onClick Event eines Buttons:
Delphi-Quellcode:
type
    { Array of form references }
    A_TForm = Array [0 .. (($fff0 div SizeOf(TForm)) - 1)]
        of TForm;
var
    ChildCount: Integer;
    CurrentMDIChildCount: Integer;
    CurrentMDIChildren: ^A_TForm;
begin
    { For some reason Delphi messes around with the MDIChildren array
      when child forms are repositioned in code, causing the routine to
      suddenly start accessing the wrong form in the middle of an
      iteration! To get around this problem, allocate some memory to
      make copies of the main form's MDIChildren array and use this
      copy throughout the rest of the routine }

    CurrentMDIChildCount := MDIChildCount;
    CurrentMDIChildren := AllocMem(CurrentMDIChildCount
        * SizeOf(CurrentMDIChildren^[0]));

    try
        { Copy all the child form references to the local
          array }

        for ChildCount := 0 to CurrentMDIChildCount - 1 do
            CurrentMDIChildren^[ChildCount] :=
                MDIChildren[ChildCount];

        for ChildCount := CurrentMDIChildCount - 1 downto 0 do
            CurrentMDIChildren^[ChildCount].WindowState := wsMinimized;

    finally
        { Free the memory allocated to the array of form
          references }

        FreeMem(CurrentMDIChildren, CurrentMDIChildCount
            * SizeOf(CurrentMDIChildren^[0]));
    end; { end try }

end;
Autor: Steve Turner, Leeds, England (gefunden in einer NewsGroup)
Armin P. Pressler

BEGIN
...real programmers are using C/C++ - smart developers Delphi;
END;
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:57 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz