Expand the treeview on startup.

This commit is contained in:
Thomas Weidenmueller 2004-01-16 01:58:28 +00:00 committed by Alexandre Julliard
parent 7342390852
commit 2678595e3f

View file

@ -148,7 +148,10 @@ static BOOL InitTreeViewItems(HWND hwndTV, LPTSTR pHostName)
if (!AddEntryToTree(hwndTV, hRoot, _T("HKEY_LOCAL_MACHINE"), HKEY_LOCAL_MACHINE, 1)) return FALSE;
if (!AddEntryToTree(hwndTV, hRoot, _T("HKEY_USERS"), HKEY_USERS, 1)) return FALSE;
if (!AddEntryToTree(hwndTV, hRoot, _T("HKEY_CURRENT_CONFIG"), HKEY_CURRENT_CONFIG, 1)) return FALSE;
/* expand and select host name */
TreeView_Expand(hwndTV, hRoot, TVE_EXPAND);
TreeView_Select(hwndTV, hRoot, TVGN_CARET);
return TRUE;
}
@ -259,7 +262,7 @@ HWND CreateTreeView(HWND hwndParent, LPTSTR pHostName, int id)
/* Get the dimensions of the parent window's client area, and create the tree view control. */
GetClientRect(hwndParent, &rcClient);
hwndTV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, _T("Tree View"),
WS_VISIBLE | WS_CHILD | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT,
WS_VISIBLE | WS_CHILD | WS_TABSTOP | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT,
0, 0, rcClient.right, rcClient.bottom,
hwndParent, (HMENU)id, hInst, NULL);
/* Initialize the image list, and add items to the control. */