Print Page | Close Window

Specify root folder for CXTShellTreeCtrl

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=2332
Printed Date: 09 November 2025 at 6:47am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Specify root folder for CXTShellTreeCtrl
Posted By: larryp
Subject: Specify root folder for CXTShellTreeCtrl
Date Posted: 06 June 2005 at 4:15pm
Is there a way to specify the starting folder for a CXTShellTreeCtrl derived class?  I don't want to display all drives and folders on my system. I want to specify a path and have only the sub-folders of this path displayed.

Thanks,

Larry 



Replies:
Posted By: Oleg
Date Posted: 08 June 2005 at 11:19pm

call

void CXTShellTreeBase::PopulateTree(LPCTSTR lpszPath)

 

:

m_wndShellTree.EnableAutoInit(FALSE);
 
m_wndShellTree.Create(WS_VISIBLE|WS_CHILD, CXTPEmptyRect(), this, 0);
 
if (m_wndShellTree.InitializeTree( XTOSVersionInfo()->IsWinXPOrGreater() ?
  (TVS_HASBUTTONS|TVS_SINGLEEXPAND|TVS_TRACKSELECT |TVS_SHOWSELALWAYS) :
    (TVS_HASBUTTONS|TVS_HASLINES|TVS_LINESATROOT) ))
 {
  m_wndShellTree.PopulateTree(_T("c:\\"));
 }

 



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: larryp
Date Posted: 09 June 2005 at 11:48am
Thanks Oleg.  That worked. 


Posted By: larryp
Date Posted: 09 June 2005 at 12:07pm
Oleg. After trying your solution, I do still have a problem.  If  I use the example program, GUI_Explorer (9.7RC1), and change the code in OnCreate to the following:

    m_shellTree.EnableAutoInit(FALSE);
    if( !m_shellTree.Create(WS_VISIBLE, CRect(0,0,0,0), this, IDC_TREE_VIEW))
    {
        TRACE0( "Unable to create tree control.\n" );
        return -1;
    }

    if (m_shellTree.InitializeTree( XTOSVersionInfo()->IsWinXPOrGreater() ?
    (TVS_HASBUTTONS|TVS_SINGLEEXPAND|TVS_TRACKSELECT |TVS_SHOWSELALWAYS) :
    (TVS_HASBUTTONS|TVS_HASLINES|TVS_LINESATROOT) ))
    {
        m_shellTree.PopulateTree (_T("C:\\Program Files"));
    }

then everything works fine until I click on the root folder.  In this case the root folder is "Program Files".  What displays in the list control view is the contents of the desktop not the contents of "Program Files".

Larry


Posted By: Oleg
Date Posted: 11 June 2005 at 3:31pm

Yes, sorry, CXTShellListBase "understood' only Desktop as root folder. :(

Please patch attached member.

http://forum.codejock.com/uploads/oleg/2005-06-11_153016_UpdateList.zip - 2005-06-11_153016_UpdateList.zip

 

Thank you for notice it.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net