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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Client rectangle not actualized after menu removal

Client rectangle not actualized after menu removal

Scheduled Pinned Locked Moved C / C++ / MFC
question
1 Posts 1 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.
  • F Offline
    F Offline
    FloatingMarc
    wrote on last edited by
    #1

    Hi, In my application I can dynamically create a menu at the top of my window and also dynamically remove it. After I created it, calling "GetClientRect" returns the correct client area (previous area-area occupied by the menu bar). Now when I remove the menu bar, the client area is not updated. Only if I resize the window or move the window will the value returned by "GetClientRect" be updated correctly. How come? Is there a workaround? BTW I remove my menu bar with following code: [source] CMenu* it=GetMenu(); if (it!=NULL) { int nb=it->GetMenuItemCount(); for (int i=0;i<nb;i++)> it->RemoveMenu(0,MF_BYPOSITION); DestroyMenu(it->m_hMenu); } [/source] Or is there a windows function I can call to force a similar behaviour like when resizing the window? Thanks

    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