diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-06-17 15:40:11 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-06-17 15:40:11 +0200 |
commit | 1b1260086d2d9831ead84f83239260966e36a7ce (patch) | |
tree | 8bb35fa1558108189c9795cf1ce3d6e6815ece6c | |
parent | 618c8d577bdfdf0155fda659560801cf19a00650 (diff) | |
download | fpGUI-1b1260086d2d9831ead84f83239260966e36a7ce.tar.xz |
gdi implementation of GetWindowState
Now we can retrieve the WindowState of TfpgForm under both Linux and
Windows.
-rw-r--r-- | src/corelib/gdi/fpg_gdi.pas | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas index 9bae51c5..ffaefff2 100644 --- a/src/corelib/gdi/fpg_gdi.pas +++ b/src/corelib/gdi/fpg_gdi.pas @@ -188,6 +188,7 @@ type procedure DoDNDEnabled(const AValue: boolean); override; procedure DoAcceptDrops(const AValue: boolean); override; procedure DoDragStartDetected; override; + function GetWindowState: TfpgWindowState; override; property WinHandle: TfpgWinHandle read FWinHandle; public constructor Create(AOwner: TComponent); override; @@ -1940,6 +1941,38 @@ begin FreeAndNil(wapplication.FDrag); end; +function TfpgGDIWindow.GetWindowState: TfpgWindowState; +const + flagsoffs = 0 * sizeof(integer); +var + placement: TWindowPlacement; +begin + Result := inherited GetWindowState; + case GetWindowLong(FWinHandle, flagsoffs) of + 1: + begin + Result := wsMaximized; { TODO: this could later become wsFullScreen or something } + end; + + 2: + begin + { Do Nothing. This is actually just vertical fullscreen } + end; + + else + begin + placement.length:= sizeof(placement); + if GetWindowPlacement(FWinHandle, placement) then + begin + case placement.ShowCmd of + SW_SHOWMAXIMIZED: result:= wsMaximized; + SW_SHOWMINIMIZED: result:= wsMinimized; + end; + end; + end; { case..else } + end; { case } +end; + constructor TfpgGDIWindow.Create(AOwner: TComponent); begin inherited Create(AOwner); |