Originally posted by: Ken
I am in the process of creating a Window File Explorer like application, your code helps me tremedously.
The question is how to create the listview on the right hand side, I have tried to added m_listCtrl as CListCtrl to the CDirTreeDemoView. I added the creation of the m_listCtrl to the CDirTreeDemoView.Create() method. And creates the column info under CDirTreeDemoView::OnInitialUpdate(), but the listCtrl still not show up on the right hand side window.
Any help is appreciated, thanks.
Ken
ReplyOriginally posted by: Bob H
I am interested in getting a version of this class that works for all Windows OSs.
ReplyOriginally posted by: Armin Mueller
This fixes run fine on W2K. I guess that W2K changes
Armin, Switzerland
CDirTreeCtrl::~CDirTreeCtrl()
/////////////////////////////////////////////////
m_imgList.DeleteImageList(); // get rid of the old one
hImgList = (HIMAGELIST)SHGetFileInfo( "C:\\",
// get a duplicate of the image list to change background colors
BOOL CDirTreeCtrl::DisplayDrives()
void CDirTreeCtrl::OnItemexpanded(NMHDR* pNMHDR, LRESULT* pResult)
BTW: Thanks again for the great tool. It is very usefull.
its images list of the file icons dynamically.
This causes missing icons if we dupilcate the list.
Therefore we get a fresh copy after each DisplayDrives()
and OnItemexpanded(). We need a copy to be able to
change the background color.
Changes inside DirTreeCtrl.cpp
{
m_imgList.DeleteImageList();
}
BOOL CDirTreeCtrl::GetSysImgList()
/////////////////////////////////////////////////
{
SHFILEINFO shFinfo;
HIMAGELIST hImgList = NULL;
0,
&shFinfo,
sizeof( shFinfo ),
SHGFI_SYSICONINDEX |
SHGFI_SMALLICON );
if ( !hImgList )
{
m_strError = "Cannot retrieve the Handle of SystemImageList!";
return false;
}
m_imgList.Attach( ImageList_Duplicate( hImgList ) );
m_imgList.SetBkColor( GetBkColor() ); // whatever color you choose
SetImageList( &m_imgList, TVSIL_NORMAL );
return true; // OK
}
{
.....
GetSysImgList(); // Added to get newest icons
return true;
}
{
....
GetSysImgList(); // Added to get newest icons
*pResult = 0;
}
Originally posted by: Konstantin Zamkov
This strange effect happens when you try to expand some deleted folder in RECYCLER under Windows 2000 (or RECYCLE BIN under Windows 98), which is not normally expanded, and strange additional icons appear in the root of the tree.
I have taken some screenshots, please, take a look here:
http://www.petpreforma.ru/bugs/bug-1-win2k.gif
http://www.petpreforma.ru/bugs/bug-1-win98.gif
Originally posted by: Ed
With this change, it behaves correctly in all cases.
<! InsertItem( "", 0, 0, hParent );
For me on W2k VC++6SP3, the demo app behaved differently
from when I put it in my application.
The change applies to the DisplayDrives() method.
By the way, I won't be using this as Nicola Delfino's
contribution looks superior. Why only display the
drives? There's a reason MS put the Desktop as the
virtual root these days!
!> ExpandItem(hParent, TVE_EXPAND);
Reply
Originally posted by: Mr.son
First,..Thank you for your good Code~!
Why System Icon is disappeared in Win2000?
I am sorry that I am not good to speak eng..
hava a nice time!
ReplyOriginally posted by: Frans
I had derived an .ocx of your very cool class and included it in a webpage.When I would reload the page the folder icons were missing.After adding these lines to CDirTreeCtrl's destructor this problem was solved.
if(m_imgList)
{
m_imgList.Detach();
m_imgList.DeleteImageList(); }
Originally posted by: prakash
I was looking for this control and find it to be useful.
However, when i use this in my application on a dialog
window, i dont see the lines connecting the folders and
also the + icon against the folders. I can see them in
the demo application. Anybody has any ideas what could be the reason.
Thanks
Prakash
Originally posted by: Sadie
Hi,
The code DirTreeCtrl - for displaying folders and files is exactly what I needed except that it is in C++ . I really need the same sort of thing in java..preferablly java swing. I really hope you can help,
Thanking you in advance,
Sadie
Originally posted by: Tommy Klausen
Great problem for me.
Help`s appriciated.
How would you go about to solve a tree that allways collapses when you are refreshing the view its inside of?
If the item selected before the refresh is a file, like in your tree it runs smooth. But, what if its a main node?
Tommy.