Bug with links to virtual stuff

Bug reports will be moved here when the described bug has been fixed

Moderators: Hacker, petermad, Stefan2, white

astrotzky
Junior Member
Junior Member
Posts: 48
Joined: 2006-09-18, 10:37 UTC

Bug with links to virtual stuff

Post by *astrotzky »

Occurs in the latest 7.0 release.

Steps to reproduce:
1. Enable "Internet Explorer" icon on the Desktop (Control Panel -> Display -> Desktop -> Customize Desktop -> Desktop icons group -> Enable the "Internet Explorer" checkbox)
2. Create a link to this icon (by dragging it with the right mouse button and choosing "create shortcut"). Note that in my tests it was impossible to create a shortcut to this item directly on the desktop.
3. Press enter on this shortcut in Total Commander.

What should happen:
- the default action (which is to "Open Home Page") should be executed

What actually happens:
- Total Commander thinks this link points to a folder so it enters this folder "\\Internet Explorer". This "folder" is empty and the parent directory is the Desktop.

I think TC thinks all this virtual items are folders (so the shortcut to them should list their contents), which is obviously not the case with "Internet Explorer"
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

If you go to the Desktop in Total Commander (via the menu), then you will see that "Internet Explorer" is shown as a folder - because Windows reports it as a folder to TC, not as a file! So how should TC know that this "folder" cannot be listed?
Author of Total Commander
https://www.ghisler.com
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

From button…

Post by *Clo »

2ghisler(Author)

:) Good morning,

• Here, I've a button in the bar for the command cm_OpenDesktop.

- From that button, I get IE shown as a file (but without any info, though), and double-clicking it starts the IE browser… :roll:

- An oddness is that I've set SingleClickStart=6, and it doesn't work there.
- Not a big deal, though.
- In the same list, only “My Documents” is shown as a folder I can open normally,
but no level up with “••” from the drive buttons…
- Just a remark, because IMHO the Desktop is the worst thing to use in handling files, I never do so.

:mrgreen: VG
Claude
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
Lefteous
Power Member
Power Member
Posts: 9536
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2ghisler(Author)
If you go to the Desktop in Total Commander (via the menu), then you will see that "Internet Explorer" is shown as a folder - because Windows reports it as a folder to TC, not as a file! So how should TC know that this "folder" cannot be listed?
There is no <DIR> entry right to the Internet Explorer icon here. It's sorted as a file.

Back to the problem. When executing the shell link file with ShellExecuteEx Internet Explorer is started as astrotzky wrote. What are you doing to execute the shell link file?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Apparently Microsoft have changed that - it is definitely a folder here in Windows 2000!
What are you doing to execute the shell link file?
I first ask the OLE object for the target name. If this fails, I just execute it. I tried it on Windows XP here: A double click on "Internet Explorer" on the Desktop does start the Internet Explorer here!

This works fine here when I enable the "Internet Explorer" on the desktop or not - it has no influence.
Author of Total Commander
https://www.ghisler.com
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

ghisler(Author) wrote:Apparently Microsoft have changed that - it is definitely a folder here in Windows 2000!
I can confirm this:
in Win2k it appears like a directory (double-click opens the empty folder in TC),
in XP like a file (double-click starts IE).

A created Link to this (Ctrl+Shift+F5) does not work in any of the two cases here
(the target in the *.LNK file will be "\\Desktop\Internet Explorer" - which windows can't find).
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
Lefteous
Power Member
Power Member
Posts: 9536
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

The item "Internet Explorer" opens Internet Explorer but that's not the point.
The point is that a link to the internet explorer opens an empty folder called \\internet explorer.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I see. I went through my code to check what TC does:
1. It loads the link as IShellLink object and resolves the link
2. It tries to get the plain path target -> fails
3. It tries to get the ItemIDList target -> success
4. It gets the IShellFolder for this ItemIDList -> success
5. It calls IShellFolder->EnumObjects -> success

-> TC assumes that it is a folder and shows it as a folder.

Why all of this? TC tries to show link targets inside of its panels if it's a file or a virtual folder. Maybe you have a better idea how to handle this?

Btw, to solve the problem, just make a link to IExplore.exe...
Author of Total Commander
https://www.ghisler.com
astrotzky
Junior Member
Junior Member
Posts: 48
Joined: 2006-09-18, 10:37 UTC

Post by *astrotzky »

to ghisler:

Windows Explorer opens Internet Explorer when double clicking or pressing enter on the link.
This is the expected behaviour and people will get confused otherwise.

I reported this not because it bothers me (indeed I don't even use Internet Explorer, I saw the issue on a friend's computer) but because it might reveal a problem in the way you handle virtual items.
OTOH, I wouldn't be surprised if Windows Explorer is doing something non-standard here.

So it's a bug and should be put in your bug tracking system.
It's up to you to assing it a priority (probably "very low").

As for the workaround my friend already did that :D
User avatar
Lefteous
Power Member
Power Member
Posts: 9536
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2ghisler(Author)
Maybe you have a better idea how to handle this?
Did you try IShellFolder::GetAttributesOf? The SFGAO_FOLDER flag could be used to find out if the link points to a folder.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Well, to do this, I would first have to get the parent, then get the attributes of the child. What if the parent is slow or inaccessible? I will note it for a later release, but for TC 7.01 it's just too risky.
Author of Total Commander
https://www.ghisler.com
User avatar
Lefteous
Power Member
Power Member
Posts: 9536
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2ghisler(Author)
No hurry it's not an urgent issue.

In this sample SHGetFileInfo is used to get the SFGAO_FOLDER attribute. According to the MSDN SHGetFileInfo calls IShellFolder::GetAttributesOf internally. It may be easier as it works with an absolute item id list.

Code: Select all

LPITEMIDLIST ppidl;
// m_pLink is a pointer of type IShellLink.
m_pLink->GetIDList (&ppidl);
SHFILEINFO fi;
ZeroMemory (&fi, sizeof (SHFILEINFO));
fi.dwAttributes = SFGAO_FOLDER;
SHGetFileInfo ((LPCTSTR)ppidl, 0, &fi, sizeof (SHFILEINFO), SHGFI_ATTR_SPECIFIED | SHGFI_ATTRIBUTES | SHGFI_PIDL);
fi.dwAttribute now contains the requested attribute (SFGAO_FOLDER) if the link points to a folder. I have also tried this with other lnk files which actually point to a virtual folder or physical directory and it seems to work fine.


Another hint:
You wrote that you are calling IShellLink::GetPath to get a physical path and if it fails request the item id list. To find out if the link contains a certain information you can also call IShellLinkDataList::GetFlags. I'm using this operation in my Shortcut content plug-in.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This should be fixed in TC 7.02, please test!
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3501
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

Confirm bug in 7.01 and fix in 7.02.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Confirmed fixed in TC 7.02 :-)

TC now opens Internet Explorer when clicking a .lnk file pointing to the Internet Explorer icon on the desktop.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply