Known Issues

If you have a listctrl that will just get a horizontal scrollbar and you choose to hide both of the scrollbars, the function will also remove the vertical scrollbar. But, because it is not there, some of the gfx will be cut off.

In other words, the clientarena should only be used when you KNOW how many scrollbars will be shown.

Personally, I prefer using the NcCalcSize. It removes the scrollbars pretty smoothly. It doesn't care whether the listctrl shows all scrollbars or not.

Comments

Applying "NcCalcSize" trick under CE

Posted by Codeplug
on 05/12/2004 01:24pm

I'm running CE 2.12, which doesn't support the WM_NCCALCSIZE.
Through trial and error, I discovered that the same trick works
when intercepting WM_SIZE instead of WM_NCCALCSIZE.
The only caveat is that you must call the following for the
style removal to take effect:
::SetWindowPos(hwnd, NULL, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER |
SWP_NOACTIVATE | SWP_FRAMECHANGED);
Or in terms of MFC, you would call:
ModifyStyle(WS_HSCROLL | WS_VSCROLL, 0, SWP_FRAMECHANGED);
gg