Click to See Complete Forum and Search --> : Changing the height of a CHeaderCtrl that a CListCtrl uses


April 19th, 1999, 02:19 PM
Does anyone know what mechanism a CListCtrl uses to determine where it can start drawing if you are using it in a Report mode with column headers?
I've have been using Spy++ to see what messages the CHeaderCtrl gets, but I cannot figure out what the CListCtrl is doing. I tried trapping the
HDM_LAYOUT message in the CHeaderCtrls DefWindowProc( I subclassed the header ), and from what I can tell the HDM_LAYOUT is being handled,
but when I try to change the cy value in the HD_LAYOUT under the WINDOWPOS.cy nothing happens. Any help would be greatly appreciated.

Sorry about the anon. post but the board won't recognize my password or something.
TIA,

Dan Ramage

real name
October 24th, 2005, 08:11 AM
just now i have first half-success with this source
half because i wand header smaller and first list ctrl line does not move up from original position (testing with xp look)

HRESULT CHeaderCtrlSmall::GetLayout(WPARAM wParam, LPARAM lParam)
{
HD_LAYOUT *phdLayout;
RECT *pRc;
WINDOWPOS *pWPos;

phdLayout = (HD_LAYOUT*)lParam;
pRc = phdLayout->prc;
pWPos = phdLayout->pwpos;

HRESULT lResult = CHeaderCtrl::DefWindowProc(HDM_LAYOUT, wParam, lParam);

int bottom_old = pRc->bottom;
pRc->bottom = 25;
pWPos->cy -= bottom_old - pRc->bottom;
lResult = S_OK;

return lResult;
}