Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Thread Tools Display Modes
Old 11-16-2005, 12:40 AM
digitiger digitiger is offline
Senior Member
Join Date: Jan 2001
Posts: 716
Default dimensions of Restored window (windowState = wsNormal)

I want to know as to what dimensions the main form of my delphi built application will resize after user clicks on "Restore" button.

I want to know this size so that I may reduce the size of MDI child form also if it is more than the client area of main form after the restore operation.

Kindly help

thanks a lot in advance
Reply With Quote
Old 11-16-2005, 03:05 AM
chris_w chris_w is offline
Senior Member
Join Date: Jan 2004
Posts: 1,397
Default RE: dimensions of Restored window (windowState = wsNormal)

procedure TForm1.Button1Click(Sender: TObject);
  WP : TWindowPlacement;
  pWP : PWindowPlacement;
  desktop : TRect;
  FillChar(WP, SizeOf(WP), 0);
  WP.length := SizeOf(WP);
  pWP := @WP;
  if GetWindowPlacement(Handle, pWP) then begin
    //GetWindowPlacement returns coords relative to the desktop
    desktop := Screen.DesktopRect;
    OffsetRect(WP.rcNormalPosition, desktop.Left, desktop.Top);

    ShowMessage( Format('%.0d, %.0d, %.0d, %.0d',
                         WP.rcNormalPosition.Bottom]) );

Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT. The time now is 01:51 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.