
/*this is where the children are resized*/
BOOL CALLBACK ResizeEnumProc (HWND hwnd, LPARAM lParam)
    {
    char szClassName [31];
    RECT   rect;
    int iLeft, iTop, iWidth, iHeight;
    POINT pTop, pBottom;
    resizeinfo ri;


    /*counting children*/
    if(lParam==0L)
        {iChildren++; return TRUE;}
    if(!GetWindowRect(hwnd, &rect))
        {;/*can't do anything if this fails*/ }
    /*getting the initial child size*/
    else if(lParam==1L)
        {
        ri.hControl=hwnd;
        pTop.x=rect.left;
        pTop.y=rect.top;
        pBottom.x=rect.right;
        pBottom.y=rect.bottom;
        ScreenToClient(GetParent(hwnd), &pTop);
        ScreenToClient(GetParent(hwnd), &pBottom);

        rect.left=pTop.x;
        rect.top=pTop.y;
        rect.right=pBottom.x;
        rect.bottom=pBottom.y;

        ri.rect=rect;
        pri[iCurrentChild++]=ri;
        }
    else/*resizing the controls*/
        {
        /*get the correct control*/
        ri=GetResizeInfo(hwnd);

        /*fix the horizontal size and position*/
        iLeft=(int)(dHResize*(double)ri.rect.left);
        iWidth=(int)(dHResize*(double)(ri.rect.right-ri.rect.left));

        /*fix the vertical size and position*/
        iTop=(int)(dVResize*(double)ri.rect.top);

        /*if this is anything other that a single line
          text edit, resize height (for demonstration)*/
        GetClassName(hwnd, szClassName, 30);
        AnsiUpper(szClassName);
        /*show that we can resize based on class*/
        if(strcmp(szClassName, "EDIT")==0)
            {
            LONG l=GetWindowLong(hwnd, GWL_STYLE);
            /*only ES_MULTILINE EDIT controls get resized*/
            if(l&ES_MULTILINE)
                iHeight=(int)(dVResize*
                              (double)(ri.rect.bottom-ri.rect.top));
            else
                iHeight=ri.rect.bottom-ri.rect.top;
            }
        else
            iHeight=(int)(dVResize*
                          (double)(ri.rect.bottom-ri.rect.top));
        /*move the window*/
        MoveWindow(hwnd, iLeft, iTop, iWidth, iHeight, TRUE);
        }
    return TRUE;
    }
