I have a doubt, what happens is that I need to obtain the full name of an application that is being processed in the operating system (as it appears in the task manager). the goal is if for example the process is Microsoft Edge, the name comes out like this "Microsoft Edge" and not "msedge"
This is what I have tried, but to print msedge I need the full name that appears in the file manager
uint Id;
GetWindowThreadProcessId(activatedHandle, out Id);
var Process = Process.GetProcessById((int)Id);
Console.WriteLine(Process.ProcessName);// imprime msedge
I've been looking through some forums and maybe this will help you:
At first this did not compile for me because my application is configured as 32 bits and I cannot access eg Microsoft Edge because it is 64 bits. I solved it by changing the Compilation box (Project Properties) Unchecking the Prefer 32-bit box:
You could see it a little more detailed here: Help on this problem with "Icon.ExtractAssociatedIcon"
The result that returns you is the description of the application, which is the closest thing to the name of the application that the Task Manager shows you. That is to say this:
I hope this helps you, Greetings!