find frame position correctly when minimized

svn: r3738
This commit is contained in:
Matthew Flatt 2006-07-17 03:07:58 +00:00
parent fb2b7fbf05
commit efc4ea0c7f

View File

@ -276,9 +276,17 @@ void wxFrame::GetPosition(int *x, int *y)
parent = GetParent();
GetWindowRect(GetHWND(), &rect);
point.x = rect.left;
point.y = rect.top;
if (::IsIconic(hwnd)) {
WINDOWPLACEMENT wp;
wp.length = sizeof(wp);
GetWindowPlacement(hwnd, &wp);
point.x = wp.rcNormalPosition.left;
point.y = wp.rcNormalPosition.top;
} else {
GetWindowRect(GetHWND(), &rect);
point.x = rect.left;
point.y = rect.top;
}
// Since we now have the absolute screen coords,
// if there's a parent we must subtract its top left corner