Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. GetClientRect with initial window wrong?

GetClientRect with initial window wrong?

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Harco
    wrote on last edited by
    #1

    Hi, I'm using RECT r; GetClientRect(hWnd,&r); CreateWindow(WC_EDIT,etc,etc,r.right,r.bottom....); to get the client area of my window and putting an edit control in there which should fit precisely. I noticed that the returned value for the first window created by the application is wrong. The height is 10 pixels short(about the same height as a titlebar). When used with any subsequently created windows the value is correct. Does anybody know what this is about? Maybe a bug?

    C 1 Reply Last reply
    0
    • H Harco

      Hi, I'm using RECT r; GetClientRect(hWnd,&r); CreateWindow(WC_EDIT,etc,etc,r.right,r.bottom....); to get the client area of my window and putting an edit control in there which should fit precisely. I noticed that the returned value for the first window created by the application is wrong. The height is 10 pixels short(about the same height as a titlebar). When used with any subsequently created windows the value is correct. Does anybody know what this is about? Maybe a bug?

      C Offline
      C Offline
      cje
      wrote on last edited by
      #2

      I have found that when I want to have things sized perfectly in a client that I also need to process the WM_SIZE message to maintain proper sizing of the child.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups