   Tree Views / Controls - API
  I wanted to create a tree view in my C++ WinApp but I cant seem to figure out how. I looked it up in the help file however all I found were classes yet I am used to making controls by entering the corrent className parameter into the CreateWindowEx function. How can I do this?   
Tree-View ControlsThe classname to use is WC_TREEVIEW (no quotes). Remember to first call InitCommonControls()   ;Google is your friend[google];  hello, i am having some trouble with the TreeView control when I try to add 'nodes'. Here is the code to create and add a node to the tree that I am using :LRESULT CALLBACK MDIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {switch(msg) {case WM_CREATE:{HWND tree = CreateWindowEx( WS_EX_CLIENTEDGE, WC_TREEVIEW,"",TVS_HASBUTTONS | WS_VISIBLE | WS_CHILD | TVS_HASLINES | TVS_LINESATROOT,0,0,120,300,hWnd,(HMENU)TREE_VIEW,GetModuleHandle(NULL), NULL);if(tree = NULL) {Log("Error creating Tree View","Tree View",LOGTYPE_FATAL); }TVITEMEX item;TVINSERTSTRUCT str;item.mask = TVIF_TEXT | TVIF_PARAM;item.pszText = "Hello";item.cchTextMax = lstrlen("Hello");str.itemex = item;str.hInsertAfter = TVI_LAST;str.hParent = TVI_ROOT;SendMessage(tree,TVM_INSERTITEM, 0,(LPARAM) (LPTVINSERTSTRUCT)&str);    ...When I use this the tree view appears on the window (I can see the Client Edge) yet there are no nodes. What am I doing wrong??   ;  You should check to see if SendMessage() is failing. One thing I notice is that you specify the TVIF_PARAM flag for you TVITEMEX structure but you never set the value of the lParam member but that shouldnt cause the problem.   ;  looks like you've got your structs confused. itemex is a full struct member of the TVINSERTSTRUCT struct, not just a pointer. here's a simple code snippet i use that's always worked for me:HTREEITEM TreeView::Append(HWND hTree, HTREEITEM hRoot, LPCTSTR name, int image, int selected, bool children, LPARAM lParam){    TVINSERTSTRUCT tvis;    tvis.hParent= hRoot;    tvis.hInsertAfter= TVI_LAST;    tvis.itemex.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM;    tvis.itemex.hItem= NULL;    tvis.itemex.state= 0;    tvis.itemex.stateMask = 0;    tvis.itemex.pszText   = (LPTSTR)name;    tvis.itemex.cchTextMax= 0;    tvis.itemex.iImage    = image;    tvis.itemex.iSelectedImage = selected;    tvis.itemex.cChildren = children ? TRUE : FALSE;    tvis.itemex.lParam    = lParam;    tvis.itemex.iIntegral = 1;    HTREEITEM hItem = TreeView_InsertItem(hTree, &tvis);    return hItem;};  Hi again.I used the source code that was mentioned above like this:LRESULT CALLBACK MDIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {switch(msg) {case WM_CREATE:{HWND tree = CreateWindowEx( WS_EX_CLIENTEDGE, WC_TREEVIEW,"",TVS_HASBUTTONS | TVS_HASLINES | WS_VISIBLE | WS_CHILD,10,10,150,300,hWnd,(HMENU)TREE_VIEW,GetModuleHandle(NULL), NULL);if(tree = NULL) {Log("Error creating Tree View","Tree View",LOGTYPE_FATAL); }TVINSERTSTRUCT tv;tv.hParent= TVI_ROOT;tv.hInsertAfter= TVI_FIRST;tv.itemex.mask= TVIF_TEXT;tv.itemex.pszText= "This is a test";tv.itemex.cchTextMax= lstrlen("This is a test");TreeView_InsertItem(tree, &tv);...The result is an empty tree view like in this picture:;  if(tree = NULL) {Log("Error creating Tree View","Tree View",LOGTYPE_FATAL); }This is causing the problem. You want == not =   ;  Woops, old Visual Basic Tendancies resurfacing. Thanks.   