Strange interaction among Double Commander and Total Commander

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Fla$her
Power Member
Power Member
Posts: 2298
Joined: 2020-01-18, 04:03 UTC

Re: Strange interaction among Double Commander and Total Commander

Post by *Fla$her »

2ghisler(Author)
1. What about Process32FirstW/Process32NextW? First you find processes by the TTOTAL_CMD class, then you get paths by handles and get InternalName or OriginalFileName, comparing, case-sensitive, with TOTALCMD64 or totalcmd64.exe.

2. It wasn't me who suggested checking the process names, highlighting the above as the reason for unsuitable identification.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Strange interaction among Double Commander and Total Commander

Post by *ghisler(Author) »

This uses CreateToolhelp32Snapshot, right? Isn't that quite costly and slow?
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2298
Joined: 2020-01-18, 04:03 UTC

Re: Strange interaction among Double Commander and Total Commander

Post by *Fla$her »

Right. I don't think it's slow, but it's a bit cumbersome, yes.
OK, but you are already accessing the process pool by class to get the number of instances. So, it remains to get the process path by GetModuleFileNameEx/GetProcessImageFileNameW/QueryFullProcessImageNameW and then pull the necessary from the header. Isn't it?
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Strange interaction among Double Commander and Total Commander

Post by *ghisler(Author) »

Yes, but these return just the file name of the executable. People have often renamed totalcmd.exe to Explorer.exe, because some virus scanners don't add their context menu entries when detecting a different process than the Explorer. They apparently use these functions too...
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2298
Joined: 2020-01-18, 04:03 UTC

Re: Strange interaction among Double Commander and Total Commander

Post by *Fla$her »

2ghisler(Author)
You're talking about the same thing again. After getting the paths by window class, you need to look at each found exe file for InternalName or OriginalFileName for comparison. I gave you the link above.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Strange interaction among Double Commander and Total Commander

Post by *ghisler(Author) »

I'm sorry but I will not do that. That would further slow down the already slow start of TC. :(
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2298
Joined: 2020-01-18, 04:03 UTC

Re: Strange interaction among Double Commander and Total Commander

Post by *Fla$her »

You can also check the third byte of the found *.exe. TC and DC have it different.
Overquoting is evil! 👎
Post Reply