GEtWindowRect
-
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 -
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, nsGetWindowRect 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