AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Delphi Hauptformular ausblende beim wechsel auf ein anderes Form ?
Thema durchsuchen
Ansicht
Themen-Optionen

Hauptformular ausblende beim wechsel auf ein anderes Form ?

Ein Thema von Megabyte · begonnen am 23. Nov 2002 · letzter Beitrag vom 27. Jul 2020
 
Benutzerbild von Jasocul
Jasocul

Registriert seit: 22. Sep 2004
Ort: Delmenhorst
1.371 Beiträge
 
Delphi 11 Alexandria
 
#12

AW: Hauptformular ausblende beim wechsel auf ein anderes Form ?

  Alt 24. Jul 2020, 11:48
Habe mir vor ein paar Jahren dafür zwei kleine Prozeduren gebastelt:
Delphi-Quellcode:
procedure ShowFormOnTaskbar(Form : TForm);
var
  WindowStyle : LONG_PTR;
begin
  WindowStyle := GetWindowLongPtr(Form.Handle, GWL_EXSTYLE);
  if (WindowStyle and WS_EX_APPWINDOW) <> WS_EX_APPWINDOW then
  begin
    SetWindowLongPtr(Form.Handle, GWL_EXSTYLE, WindowStyle or WS_EX_APPWINDOW);
  end;
end;

procedure HideFormFromTaskbar(Form : TForm);
var
  WindowStyle : LONG_PTR;
begin
  WindowStyle := GetWindowLongPtr(Form.Handle, GWL_EXSTYLE);
  if (WindowStyle and WS_EX_APPWINDOW) = WS_EX_APPWINDOW then
  begin
    SetWindowLongPtr(Form.Handle, GWL_EXSTYLE, WindowStyle xor WS_EX_APPWINDOW);
  end;
end;
Zur Sicherheit kann man vielleicht noch prüfen, ob die Form assigned ist, bevor man damit hantiert.
Aber eine kleine Warnung noch:
Wenn die Anwendung dann im aktuellen Fenster ungünstig abschmiert, kommt man evtl. nicht mehr ins vorherige Fenster zurück, da es ja nicht mehr sichtbar ist.
Peter
  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 05:26 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