Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!male!texsun!letni!rwsys!spudge!johnm From: johnm@spudge.UUCP (John Munsch) Newsgroups: comp.windows.ms.programmer Subject: Re: Can't get AdjustWindowRect to work Message-ID: <27331@spudge.UUCP> Date: 5 Feb 91 21:30:31 GMT References: <175@maillot_.gtephx.UUCP> Reply-To: johnm@spudge.UUCP (John Munsch) Organization: Friends of Guru Bob Lines: 31 In article <175@maillot_.gtephx.UUCP> corfmanr@gtephx.UUCP (Russ Corfman) writes: > I'm trying to get my application's window to be a certain size. [Lots trimmed for brevity.] >passed rectangle. One thing I just thought of is that it may have >modified the upper left corner of the rectangle. I was assuming it >modified the lower right since client windows always have an upper >left corner of (0,0). If this is the case, it seems a bit inconsistent >to me. Inconsistency is the name of the game with the Microsoft SDK. An excerpt from some of my own code: // Figure out what the new size of the window should be, taking // into account things like menus and title bars, etc. GetWindowRect(hOutputWnd, (LPRECT) &CurrentWndRect); WndRect.left = WndRect.top = 0; WndRect.bottom = image_descriptor.height; WndRect.right = image_descriptor.width; AdjustWindowRect((LPRECT) &WndRect, WS_OVERLAPPEDWINDOW, TRUE); // Resize the window to accomodate the new image size. MoveWindow(hOutputWnd, CurrentWndRect.left, CurrentWndRect.top, abs(WndRect.right - WndRect.left), abs(WndRect.bottom - WndRect.top), TRUE); It is perfectly normal for AdjustWindowRect() to return negative values for top and left. John Munsch