Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7551099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:23:31+00:00 2026-05-30T10:23:31+00:00

How can I maximize a child window that fits only the client area but

  • 0

How can I maximize a child window that fits only the client area but not an entire parent window? I don’t want that the child window disappears under a main menu or other controls of the parent window.

I have this code

procedure WMSIZE(var Msg: TMessage); message WM_SIZE;

procedure TForm2.WMSIZE(var Msg: TMessage);
begin
  inherited;
  if Msg.WParam = SIZE_MAXIMIZED then
  begin
    ShowWindow(Handle, SW_RESTORE);
    Left := 0;
    Top := 0;
    Width := Form1.ClientWidth - 4; // The BORDER
    Height := Form1.ClientHeight - 4;
  end;
end;

But it’s not good enough. The window is actually not maximized. If to change SW_RESTORE to SW_MAXIMIZE then the child window looks buggy.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T10:23:32+00:00Added an answer on May 30, 2026 at 10:23 am

    Normally, the MDI main form’s client space should be calculated automatically to the space without menu or bars, provided that those bars are aligned to an edge of the form.

    When a bar or other controls are not aligned, then you indeed have to adjust yourself. Handle WM_NCCALCSIZE to tell windows your form has deviating client rect dimensions.

    Or take a look at NLDExtraMDIProps in which I catch WM_SYSCOMMAND when WParam and $FFF0 = SC_MAXIMIZE to adjust the size of a MDI child window. The component provides in a few extra properties like: BackgroundPicture, CleverMaximizing, ShowClientEdge and ShowScrollBars.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I noticed that in Windows, if you maximize a window you can not resize
There is the good component to maximize a child window in a client area
Can a LINQ enabled app run on a machine that only has the .NET
I get want to know whether we can maximize and minimize a whole application.
Can I find out if my toplevel window is maximized, and can I maximize
Somehow, Expression Blend has entered full-screen mode (no window chrome), but I can still
I'm making an appication that needs to maximize the window of another application. In
In WPF, how can I hide the minimize button (only the minimize, not also
I am trying to get showstate of a window. I know that I can
Hey is there anyway that in your program you can add a minimize/ maximize

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.