• Vista Tree-View control with auto-scroll style

    From cptpersonal@gmail.com@21:1/5 to All on Thu Oct 17 18:01:55 2019
    It's been 13 years since this thread was active, and as far as I can see MS hasn't added anything to the API to fix this situation, which I've just recently been wrestling with myself. The combination of Custom-draw and auto-scroll doesn't seem that far-
    fetched to me, and I can't believe the problem has been such a low priority there in Redmond. Anyway, I figured out a kludge. When my TreeView is created, I obtain the text-rectangle of the first item in the tree:

    HTREEITEM hFirst = TreeView_GetRoot(hwnd);
    RECT rcFirst;
    TreeView_GetItemRect(hwnd, hFirst, &rcFirst, true);

    I then make a record of the initial rcFirst.left, and continue to monitor it every time drawing occurs. With each drawing, the same three lines execute, and the changes in the rcFirst.left values over time allow me to compute the true scroll position.

    Cheers,
    Christopher Taylor
    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)