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 7401501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:29:06+00:00 2026-05-29T04:29:06+00:00

I want to compute the minimum size both vertical and horizontal that will contain

  • 0

I want to compute the minimum size both vertical and horizontal that will contain a dialog.
I used GetClientRect to determine the width and height. Then for the width when a vertical scroll bar is needed I added GetSystemMetrics (SM_CXVSCROLL) + GetSystemMetrics (SM_CXSIZEFRAME) but I seem to come up a few pixels short.

What GetSysMetrics do I need to take into account for both the horizontal and vertical dimensions with and without scroll bars?

  • 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-29T04:29:08+00:00Added an answer on May 29, 2026 at 4:29 am

    You need to account for window borders and other non-client area space. The easiest way to do this is use AdjustWindowRect() or AdjustWindowRectEx(). However, you will still need to handle the scroll bars yourself:

    From the documentation:

    The AdjustWindowRectEx function does not take the WS_VSCROLL or WS_HSCROLL styles into account. To account for the scroll bars, call the GetSystemMetrics function with SM_CXVSCROLL or SM_CYHSCROLL.

    So, the steps are:

    1. GetClientRect() to get your minimum size client area.

    2. AdjustWindowRectEx() to convert the client size to window size based on your window styles.

    3. If needed, apply additional adjustments to account for scroll bars (GetSystemMetrics() with SM_CXVSCROLL and/or SM_CYHSCROLL).

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

Sidebar

Related Questions

I want to ask how to add a computed column in BIRT that compute
I will phrase the problem in the precise form that I want below: Given
Given an array A[1..n] , we want to compute another array B[1..n] such that
Given the list ['a','ab','abc','bac'] , I want to compute a list with strings that
I want to compute the time 4 hours later during the DST transition, either
For use in a rigid body simulation, I want to compute the mass and
I want to create a persisted computed column in a table so that I
I have a Pig program where I am trying to compute the minimum center
I want to compute result from this table. I want quantity 1 - quantity2
I want to compute the moment of inertia of a (2D) concave polygon. I

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.