AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Delphi How to prevent window title bar height changes when app is maximized
Thema durchsuchen
Ansicht
Themen-Optionen

How to prevent window title bar height changes when app is maximized

Ein Thema von jimsweb · begonnen am 29. Jun 2022 · letzter Beitrag vom 30. Jun 2022
Antwort Antwort
Seite 2 von 2     12   
jimsweb

Registriert seit: 30. Mai 2013
5 Beiträge
 
#11

AW: How to prevent window title bar height changes when app is maximized

  Alt 29. Jun 2022, 18:43
thank you everyone.

I followed your valuable suggestions and somehow made it work.. It just works, however since we are capturing maximize action manually and setting the form size to desktop width and height, i cannot enable or display restore button.

is there a way to show restore button after the form has been expanded to cover the screen?
Is there a way to preven the form not to get expanded beyond task bar area? Currently the form gets expanded and goes under taskbar causing some of the elements to be hidden..

Code:
procedure TForm1.WMSyscommand(var Msg: TWmSysCommand);
begin
  case (Msg.cmdtype and $FFF0) of
    SC_MINIMIZE:
      begin
        // ...
      end;
    SC_RESTORE:
      begin
        // ...
      end;
    SC_MAXIMIZE:
      begin
        ShowMessage('ha Maximize');

       
        Form1.Width := screen.Width;
        Form1.Height := screen.Height;
       
        Form1.Left := 0;
        Form1.Top := 0;

        exit; // use exit if you want to cancel maximize
      end;
  end;
  inherited;
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.142 Beiträge
 
Delphi 12 Athens
 
#12

AW: How to prevent window title bar height changes when app is maximized

  Alt 29. Jun 2022, 19:47
Zitat:
exit; // use exit if you want to cancel maximize
TWmSysCommand has a result that should be set accordingly.

and from within a form method, NEVER use the global form variable!!!!
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat
jimsweb

Registriert seit: 30. Mai 2013
5 Beiträge
 
#13

AW: How to prevent window title bar height changes when app is maximized

  Alt 30. Jun 2022, 05:42
Zitat:
exit; // use exit if you want to cancel maximize
TWmSysCommand has a result that should be set accordingly.

and from within a form method, NEVER use the global form variable!!!!
thank you - can you please advise on below.

is there a way to show restore button after the form has been expanded to cover the screen?
Is there a way to preven the form not to get expanded beyond task bar area? Currently the form gets expanded and goes under taskbar causing some of the elements to be hidden..
  Mit Zitat antworten Zitat
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.541 Beiträge
 
Delphi 11 Alexandria
 
#14

AW: How to prevent window title bar height changes when app is maximized

  Alt 30. Jun 2022, 07:17
Try SystemParameterInfo with SPI_GETWORKAREA as uiAction-Parameter.
Zitat:
Retrieves the size of the work area on the primary display monitor. The work area is the portion of the screen not obscured by the system taskbar or by application desktop toolbars. The pvParam parameter must point to a RECT structure that receives the coordinates of the work area, expressed in physical pixel size. Any DPI virtualization mode of the caller has no effect on this output.
To get the work area of a monitor other than the primary display monitor, call the GetMonitorInfo function.
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 2 von 2     12   


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 00:29 Uhr.
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