@@ -119,7 +119,7 @@ VOID WepFillWindowInfo(
119119 Node -> HasChildren = !!FindWindowEx (hwnd , NULL , NULL , NULL );
120120}
121121
122- VOID WepAddChildWindowNode (
122+ PWE_WINDOW_NODE WepAddChildWindowNode (
123123 _In_ PWE_WINDOW_TREE_CONTEXT Context ,
124124 _In_opt_ PWE_WINDOW_NODE ParentNode ,
125125 _In_ HWND hwnd
@@ -129,21 +129,26 @@ VOID WepAddChildWindowNode(
129129
130130 childNode = WeAddWindowNode (Context );
131131 childNode -> WindowHandle = hwnd ;
132- WepFillWindowInfo (childNode );
133132
134- childNode -> Node . Expanded = FALSE ;
133+ WepFillWindowInfo ( childNode ) ;
135134
136135 if (ParentNode )
137136 {
138137 // This is a child node.
138+ childNode -> Node .Expanded = FALSE;
139139 childNode -> Parent = ParentNode ;
140+
140141 PhAddItemList (ParentNode -> Children , childNode );
141142 }
142143 else
143144 {
144145 // This is a root node.
146+ childNode -> Node .Expanded = TRUE;
147+
145148 PhAddItemList (Context -> NodeRootList , childNode );
146149 }
150+
151+ return childNode ;
147152}
148153
149154VOID WepAddChildWindows (
@@ -171,7 +176,12 @@ VOID WepAddChildWindows(
171176 (!FilterThreadId || UlongToHandle (threadId ) == FilterThreadId )
172177 )
173178 {
174- WepAddChildWindowNode (& Context -> TreeContext , ParentNode , childWindow );
179+ PWE_WINDOW_NODE childNode = WepAddChildWindowNode (& Context -> TreeContext , ParentNode , childWindow );
180+
181+ if (childNode -> HasChildren )
182+ {
183+ WepAddChildWindows (Context , childNode , childWindow , NULL , NULL );
184+ }
175185 }
176186
177187 i ++ ;
@@ -210,7 +220,6 @@ VOID WepRefreshWindows(
210220{
211221 TreeNew_SetRedraw (Context -> TreeNewHandle , FALSE);
212222 WeClearWindowTree (& Context -> TreeContext );
213- TreeNew_NodesStructured (Context -> TreeNewHandle );
214223
215224 switch (Context -> Selector .Type )
216225 {
@@ -227,7 +236,6 @@ VOID WepRefreshWindows(
227236 WepAddChildWindows (Context , desktopNode , desktopNode -> WindowHandle , NULL , NULL );
228237
229238 desktopNode -> HasChildren = TRUE;
230- desktopNode -> Opened = TRUE;
231239 }
232240 break ;
233241 case WeWindowSelectorThread :
@@ -247,6 +255,7 @@ VOID WepRefreshWindows(
247255 break ;
248256 }
249257
258+ TreeNew_NodesStructured (Context -> TreeNewHandle );
250259 TreeNew_SetRedraw (Context -> TreeNewHandle , TRUE);
251260}
252261
@@ -401,7 +410,7 @@ INT_PTR CALLBACK WepWindowsDlgProc(
401410 PhApplyTreeNewFilters (& context -> TreeContext .FilterSupport );
402411
403412 TreeNew_NodesStructured (context -> TreeNewHandle );
404- // PhInvokeCallback(&SearchChangedEvent, SearchboxText);
413+ // PhInvokeCallback(&SearchChangedEvent, SearchboxText);
405414 }
406415 }
407416 break ;
@@ -745,19 +754,6 @@ INT_PTR CALLBACK WepWindowsDlgProc(
745754 PhResizingMinimumSize ((PRECT )lParam , wParam , MinimumSize .right , MinimumSize .bottom );
746755 }
747756 break ;
748- case WM_WE_PLUSMINUS :
749- {
750- PWE_WINDOW_NODE node = (PWE_WINDOW_NODE )lParam ;
751-
752- if (!node -> Opened )
753- {
754- TreeNew_SetRedraw (context -> TreeNewHandle , FALSE);
755- WepAddChildWindows (context , node , node -> WindowHandle , NULL , NULL );
756- node -> Opened = TRUE;
757- TreeNew_SetRedraw (context -> TreeNewHandle , TRUE);
758- }
759- }
760- break ;
761757 }
762758
763759 return FALSE;
0 commit comments