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. GEtWindowRect

GEtWindowRect

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.
  • N Offline
    N Offline
    ns
    wrote on last edited by
    #1

    I want the location and size of my CDialog that was spawned by a CView. In the OnDestroy of the mainframe I will save the location,size etc. I have access to the CDIalog object I created. SO if I do

    imageDisplay.GetWindowRect(&rect);
    

    what will come back in rect? imageDisplay = *pdlg where pdlg was the modeless dialog pointer used in pdlg->Create() Is this rect.top, .left etc not in terms of the coordinates of the Computer screen? MSDN says : Copies the dimensions of the bounding rectangle of the CWnd object to the structure pointed to by lpRect. The dimensions are given in screen coordinates Someone said to use GetWindowPlacement. Wont the GetWindowRect give me everything I need? For GetWindowPlacement MSDN says: rcNormalPosition Specifies the window’s coordinates when the window is in the normal (restored) position. but doesnt tell me what the coordinates origin is... Appreciate your help, ns

    O 1 Reply Last reply
    0
    • N ns

      I want the location and size of my CDialog that was spawned by a CView. In the OnDestroy of the mainframe I will save the location,size etc. I have access to the CDIalog object I created. SO if I do

      imageDisplay.GetWindowRect(&rect);
      

      what will come back in rect? imageDisplay = *pdlg where pdlg was the modeless dialog pointer used in pdlg->Create() Is this rect.top, .left etc not in terms of the coordinates of the Computer screen? MSDN says : Copies the dimensions of the bounding rectangle of the CWnd object to the structure pointed to by lpRect. The dimensions are given in screen coordinates Someone said to use GetWindowPlacement. Wont the GetWindowRect give me everything I need? For GetWindowPlacement MSDN says: rcNormalPosition Specifies the window’s coordinates when the window is in the normal (restored) position. but doesnt tell me what the coordinates origin is... Appreciate your help, ns

      O Offline
      O Offline
      Oliver Anhuth
      wrote on last edited by
      #2

      GetWindowRect tells the current screen coordinates. GetWindowPlacement will tell you if the window is minimized, maximized or restored (normal) and it will tell you the coordinates of the window in restored state. These may be different from the current ones e.g. when the window is maximized. Oliver

      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