Re: Getting AdjustWindowRect() to work correctly ???

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Peter Olcott" <NoSpam@xxxxxxxxxxxxx> wrote in message
news:OIfMh.24797$mJ1.6976@xxxxxxxxxxxxxxx
My current problem is that it fails to account for scrollbars, even when
scrollbars are explicitly specified.

RECT NewWindowSize;
if (!AdjustWindowRect(&NewWindowSize,
WS_OVERLAPPEDWINDOW |
WS_HSCROLL | WS_VSCROLL, TRUE))
AfxMessageBox("AdjustWindowRect() Did Not Work!");


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/adjustwindowrect.asp

"The AdjustWindowRect function does not take the WS_VSCROLL or WS_HSCROLL
styles into account. To account for the scroll bars, call the
GetSystemMetrics function with SM_CXVSCROLL or SM_CYHSCROLL"

--
Jeff Partch [VC++ MVP]


.



Relevant Pages

  • Re: 4.9 code change
    ... "Scrollbars not being taken into account with JavaScript"http://groups.google.com/group/mozilla.dev.tech.javascript/browse_frm ... ... I do agree with the OP that while saying "canvas" it is not assumed ... "available space plus scrollbars" but "available space for placing ...
    (comp.lang.javascript)
  • How to get _true_ client area of datagrid
    ... I need to get the actual client area of the datagrid. ... DataGrid.ClientSize doesn't seem to take into account: borders and scrollbars ...
    (microsoft.public.dotnet.languages.csharp)