ShellExecute instead of executing the associated file directly?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Woailizhi
Junior Member
Junior Member
Posts: 66
Joined: 2020-11-14, 08:05 UTC
Location: Poland
Contact:

ShellExecute instead of executing the associated file directly?

Post by *Woailizhi »

As far as I know TC calls the associated file through CMD instead of ShellExecute rendering opening files very slowly. Is there any way to switch this behavior?

With best regards,
Nuno.

With eterenal love to history and China.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6981
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: ShellExecute instead of executing the associated file directly?

Post by *Horst.Epp »

What is the source of your false information ?
There is no cmd involved to start any program or file.
If the start of programs or files are slow you may have hardware/software problems
or your Anti-virus solution is delaying all operations.
Windows 11 Home, Version 24H2 (OS Build 26100.4061)
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
User avatar
Dalai
Power Member
Power Member
Posts: 9974
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: ShellExecute instead of executing the associated file directly?

Post by *Dalai »

AFAIK TC calls ShellExecuteEx when Enter is pressed on a file. When pressing Shift+Enter, TC uses its own wrapper noclose.exe which indirectly (?) opens cmd.exe.

Slow operations are probably caused by Windows Defender or a similar anti-virus program.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Woailizhi
Junior Member
Junior Member
Posts: 66
Joined: 2020-11-14, 08:05 UTC
Location: Poland
Contact:

Re: ShellExecute instead of executing the associated file directly?

Post by *Woailizhi »

I have read it on one forum. The topic was addressing my specific issue. I do not have such a problem in Explorer, so I asked. Sorry for the misinformation.

With best regards,
Nuno.

With eterenal love to history and China.
Woailizhi
Junior Member
Junior Member
Posts: 66
Joined: 2020-11-14, 08:05 UTC
Location: Poland
Contact:

Re: ShellExecute instead of executing the associated file directly?

Post by *Woailizhi »

Oh, I badly mistaken the terms. Sorry! The topic in question is
https://hydrogenaud.io/index.php?topic=85926.0

With best regards,
Nuno.

With eterenal love to history and China.
Woailizhi
Junior Member
Junior Member
Posts: 66
Joined: 2020-11-14, 08:05 UTC
Location: Poland
Contact:

Re: ShellExecute instead of executing the associated file directly?

Post by *Woailizhi »

The problem really exists and is really troublesome.
When you associate Foobar 2K with Audio and open an MP3 file from explorer, it loads slower for the first time, but subsequent files are read instantly, while in TC, it is very slow.
Can I fix?

With best regards,
Nuno.

With eterenal love to history and China.
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: ShellExecute instead of executing the associated file directly?

Post by *gdpr deleted 6 »

Horst.Epp wrote: 2021-03-10, 14:48 UTC What is the source of your false information ?
There is no cmd involved to start any program or file.
If the start of programs or files are slow you may have hardware/software problems
or your Anti-virus solution is delaying all operations.
With respect to foobar2000 (as it has been mentioned in this topic now), TC does indeed start foobar2000 noticably slower than Explorer (at least on Win7). Personally, i don't care much about the speed foobar2000's is starting up with, but i guess some technical info can be beneficial to judge the situation correctly.

It's not a HW problem, it's not an antivirus software problem (and there is of course no CMD involved either way). The problem -- or rather limitation -- seems to be with TC. And i am not sure either whether the limitation is specific to TC, or whether other file managers/shells would behave similarly.

The issue is related to foobar2000's shell integration. If you start foobar2000 by hitting Enter on a media file in Explorer, you can see the effect of the shell integration in the unusual commandline with which foobar2000 is being started. Screenshot from Task Manager: https://i.imgur.com/0BBGTHg.png (remember, this is on Win7; i have no idea if the situation is the same in Win10). If you look into the shell extension DLL belonging to foobar2000, you will find the format string used to generate such a commandline string.

On the other hand, hitting Enter on the same media file in TC, and the commandline used to start foobar2000 looks remarkably different: https://i.imgur.com/pWS0UQV.png

Dalai wrote: 2021-03-10, 15:18 UTC AFAIK TC calls ShellExecuteEx when Enter is pressed on a file. When pressing Shift+Enter, TC uses its own wrapper noclose.exe which indirectly (?) opens cmd.exe.
Foobar2000 defines "play" as the default verb, but TC doesn't recognize it as the default verb. But even manually making the "play" verb the default verb using TC's "Associate" dialog will not help (it will just add the /playnow commandline argument and doesn't result in the "fast start" commandline captured in the screenshot i mentioned above). I am kinda blindly speculating that to fast-start foobar2000 utilizing its shell integration, DDE has to be used, but i am unable to validate my blind speculation since i have no clue how this should be done in TC's "Associate" dialog. (As an aside, opening context menu on the file in TC and selecting "Play in foobar2000" fast-starts foobar2000 as expected.)
Woailizhi
Junior Member
Junior Member
Posts: 66
Joined: 2020-11-14, 08:05 UTC
Location: Poland
Contact:

Re: ShellExecute instead of executing the associated file directly?

Post by *Woailizhi »

Explorer ^2 plays the file fast too

With best regards,
Nuno.

With eterenal love to history and China.
User avatar
Usher
Power Member
Power Member
Posts: 1726
Joined: 2011-03-11, 10:11 UTC

Re: ShellExecute instead of executing the associated file directly?

Post by *Usher »

@elgonzo
Do you know that this stupid imgur converts png images to jpg? Watch your images in worse quality:
https://i.imgur.com/0BBGTHgh.jpg
https://i.imgur.com/pWS0UQVh.jpg
Andrzej P. Wozniak
Polish subforum moderator
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: ShellExecute instead of executing the associated file directly?

Post by *gdpr deleted 6 »

2Usher
I know and i don't care. (The perks of uploading images to imgur anonymously. You're welcome... :wink: )

Why would i? As long as the images show what they need to show i am not bothered. It's not like you must read the commandlines in these screenshots character by character. As long as the images don't become indecipherable, i put more import on the images staying online for long times. And in this department imgur hasn't disappointed so far...
User avatar
Usher
Power Member
Power Member
Posts: 1726
Joined: 2011-03-11, 10:11 UTC

Re: ShellExecute instead of executing the associated file directly?

Post by *Usher »

elgonzo wrote: 2021-03-17, 18:59 UTCI know and i don't care.
But you can provide direct links to jpg files rather than linking to a stupid website with all power and time consuming bells-and-whistles… ;-p
Andrzej P. Wozniak
Polish subforum moderator
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: ShellExecute instead of executing the associated file directly?

Post by *gdpr deleted 6 »

Usher wrote: 2021-03-17, 21:18 UTCBut you can provide direct links to jpg files rather than linking to a stupid website with all power and time consuming bells-and-whistles… ;-p
I did link directly to the images. Note the i.imgur.com host name beginning with i-dot there in my screenshot links. :?
Woailizhi
Junior Member
Junior Member
Posts: 66
Joined: 2020-11-14, 08:05 UTC
Location: Poland
Contact:

Re: ShellExecute instead of executing the associated file directly?

Post by *Woailizhi »

Going back to my problem though, can I fix it or not?

With best regards,
Nuno.

With eterenal love to history and China.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6981
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: ShellExecute instead of executing the associated file directly?

Post by *Horst.Epp »

Woailizhi wrote: 2021-03-18, 13:09 UTC Going back to my problem though, can I fix it or not?
Only Christian can answer this
Windows 11 Home, Version 24H2 (OS Build 26100.4061)
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
User avatar
Usher
Power Member
Power Member
Posts: 1726
Joined: 2011-03-11, 10:11 UTC

Re: ShellExecute instead of executing the associated file directly?

Post by *Usher »

2elgonzo
Linking to a non-existing image (png in this case) either displays "404 Not found" or a folder using that name (which runs all the bells-and-whistles).

2Woailizhi
I suspect that Christian must test which OS versions are possible to properly handle ShellExecute as you requested. Such tests are needed to keep compatibility with older Windows.
Andrzej P. Wozniak
Polish subforum moderator
Post Reply