Page 2 of 2

Re: Strange interaction among Double Commander and Total Commander

Posted: 2023-04-26, 10:50 UTC
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.

Re: Strange interaction among Double Commander and Total Commander

Posted: 2023-05-01, 09:15 UTC
by ghisler(Author)
This uses CreateToolhelp32Snapshot, right? Isn't that quite costly and slow?

Re: Strange interaction among Double Commander and Total Commander

Posted: 2023-05-01, 10:57 UTC
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?

Re: Strange interaction among Double Commander and Total Commander

Posted: 2023-05-02, 16:22 UTC
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...

Re: Strange interaction among Double Commander and Total Commander

Posted: 2023-05-02, 17:42 UTC
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.

Re: Strange interaction among Double Commander and Total Commander

Posted: 2023-05-03, 10:13 UTC
by ghisler(Author)
I'm sorry but I will not do that. That would further slow down the already slow start of TC. :(

Re: Strange interaction among Double Commander and Total Commander

Posted: 2023-05-03, 16:51 UTC
by Fla$her
You can also check the third byte of the found *.exe. TC and DC have it different.