i have problem, how to get icon program .exe i have application i created and my application Process and kill but how to user know what program need to close it or start it.
The way is by showing the image of the program but how??
note: is there way to use Path?? example: "C:\Users\NameUser\Desktop\Chrome.exe" GetIcon
im using visual studio windows forms C#
Thank You for hlep
the first answer the 2 code it doesn't work enter image description here
CodePudding user response:
Does this help you?
var icon = Icon.ExtractAssociatedIcon(exeFilePath);
For a picture box you can use
pictureBox.Image = Icon.ExtractAssociatedIcon(exeFilePath)?.ToBitmap();