Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Specify root folder for CXTShellTreeCtrl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Specify root folder for CXTShellTreeCtrl

 Post Reply Post Reply
Author
Message
larryp View Drop Down
Groupie
Groupie


Joined: 15 January 2005
Location: United States
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote larryp Quote  Post ReplyReply Direct Link To This Post Topic: Specify root folder for CXTShellTreeCtrl
    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 
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
larryp View Drop Down
Groupie
Groupie


Joined: 15 January 2005
Location: United States
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote larryp Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2005 at 11:48am
Thanks Oleg.  That worked. 
Back to Top
larryp View Drop Down
Groupie
Groupie


Joined: 15 January 2005
Location: United States
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote larryp Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 11 June 2005 at 3:31pm

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

Please patch attached member.

2005-06-11_153016_UpdateList.zip

 

Thank you for notice it.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.078 seconds.