Originally posted by: Guan
SHGetFileInfo() will not return folder icon for CDROM devices in Win2K but it will for Win9X. Not sure if this happens on remote drives, but here's a fix.
// SHGetFileInfo will fail if it's a CDROM folder
// so we do this
// GetLength > 3 to make sure it is not X:\ but a folder
CString strOriginal = strTemp;
BOOL bIsCDROMFolder = FALSE;
if ((::GetDriveType(strTemp) == DRIVE_CDROM) && (strTemp.GetLength() > 3) ) {
bIsCDROMFolder = TRUE;
char buf[MAX_PATH];
if (GetSystemDirectory(buf,MAX_PATH) != 0) {
strTemp = buf; // pass in Windows system folder
}
}
.....
// we only need the index of the system image list
DestroyIcon( shFinfo.hIcon );
if (bIsCDROMFolder == TRUE) { // re-assign
strTemp = strOriginal;
}
Originally posted by: Joe
Doesn't work for CDROM drives, you can't view folders or files
Anyone have a fix??
Originally posted by: Jon
Reply
Originally posted by: alan
Is there a way to display the network drives ("Entire Network"), or even the desktop folders or My Computer instead of just drives on computer?
Thanks if you know a way to implement this in this class.
ReplyOriginally posted by: Marc Franzmeier
I checkt out the demo-program. It is a great solution to the problems i habe. But it takes too much time, until a folder with a bigger number of subfolders opens (let's say more than 50). You can't expect the user to wait several seconds, until something happens on the screen.
I'm working with Windows NT. Is that the reason, why it takes so mutch time, to open bigger folders ?
Does anybody have an idea of a faster solution, to show direktory entries in a dialog ?
Originally posted by: Ben S
Has anyone had this problem?
When I bring up my dialog with this control on it in Windows 2000 the icons for the folders aren't there, nor are the floppy or CD icons, but for some reason the hard drive ones are. This happens consistently. Then when I cancel that dialog, then open it again, everything works like normal. This never happens on Win98, not sure about NT or 95 because I don't use them very much. I did try going into my code and repeating OnInitDialog for my dialog so it was initialized twice, this worked, but seemed like a pretty crappy fix.
Reply
Originally posted by: Larry Johnston
A minor bug: When you want to set the root to something other than a drive ...
m_TreeCtrl.DisplayTree("c:\temp", TRUE);
... and then want to highlight a file / directory...
m_TreeCtrl.SetSelPath("c:\temp\junk.txt");
... it will not find this file to highlight it.
Make the following change to the SetSelPath() method - rather than ...
if ( !hParent ) // Not found!
... replace with ...
if ( !hParent ) // Not found, but keep looking
Also, you may want to ensure the selection is visible by adding in ...
EnsureVisible( hParent );
after ...
SelectItem( hParent ); // select the last expanded item
Thanks for this - it saved me a lot of time.
break;
{
pszPath[i] = '\\';
continue;
}
Originally posted by: Pushpasheel Tawade
I am trying to implement a drag and drop similar to Windows Explorer. What I want to do is to copy a folder (with some binary files) from the tree control in my application to some other folder selected from Windows Explorer. Has someone done something like this before. Your help would be appreciated.
-Pushpasheel
ReplyOriginally posted by: Xavi Verd
I include this class in my project. I use a dialog. When I compile the demo project it's go OK but when I do the same in my project the scheme (I don't know how to say it, the lines and + and -) it doesn't appear.
I don't Know what I'm doing wrong.
Please help me.
Thanks,
Xavi.
Originally posted by: Eric Schmidt
After I create the tree I want the user to be able to set the new path by typing the value in to an edit box and clicking at button. But the path never changes after the tree is created. The getchilditem always returns null even if I pass it TVI_ROOT?
Reply