Joachim Priesner : comctl32: Fix comments explaining visibleOrder and firstVisible.

Alexandre Julliard julliard at
Mon Feb 1 09:24:45 CST 2016

Module: wine
Branch: master
Commit: f0b6584da6e077ccc09a0c6ff6db768221ad0379

Author: Joachim Priesner <joachim.priesner at>
Date:   Fri Jan 29 22:04:10 2016 +0100

comctl32: Fix comments explaining visibleOrder and firstVisible.

Hopefully this clears up the confusion between a) visible as in "all
ancestors are expanded" and b) visible as in "within the part of the
tree that is displayed on the screen".

Also, the claim that firstVisible has visible order 0 was false.

Signed-off-by: Joachim Priesner <joachim.priesner at>
Signed-off-by: Nikolay Sivov<nsivov at>
Signed-off-by: Alexandre Julliard <julliard at>


 dlls/comctl32/treeview.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c
index 695745c..e0e9945 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -96,7 +96,7 @@ typedef struct tagTREEVIEW_INFO
   HTREEITEM	focusedItem;    /* item that was under the cursor when WM_LBUTTONDOWN was received */
   HTREEITEM     editItem;       /* item being edited with builtin edit box */
-  HTREEITEM     firstVisible;   /* handle to first visible item */
+  HTREEITEM     firstVisible;   /* handle to item whose top edge is at y = 0 */
   LONG          maxVisibleOrder;
   HTREEITEM     dropItem;       /* handle to item selected by drag cursor */
   HTREEITEM     insertMarkItem; /* item after which insertion mark is placed */
@@ -162,7 +162,10 @@ typedef struct _TREEITEM    /* HTREEITEM is a _TREEINFO *. */
   LONG      imageOffset;
   LONG      textOffset;
   LONG      textWidth;      /* horizontal text extent for pszText */
-  LONG      visibleOrder;   /* visible ordering, 0 is first visible item */
+  LONG      visibleOrder;   /* Depth-first numbering of the items whose ancestors are all expanded,
+                               corresponding to a top-to-bottom ordering in the tree view.
+                               Each item takes up "item.iIntegral" spots in the visible order.
+                               0 is the root's first child. */
   const TREEVIEW_INFO *infoPtr; /* tree data this item belongs to */

More information about the wine-cvs mailing list