开发者

How do I extract Icons embedded into a .exe using WPF?

开发者 https://www.devze.com 2023-03-12 16:58 出处:网络
Given a folder full of .exe files, I need to build a toolbar that displays each .exe file\'s embedded icon. I\'ve seen solutions u开发者_C百科sing WinForms ( Get program icons ) , but how can I do thi

Given a folder full of .exe files, I need to build a toolbar that displays each .exe file's embedded icon. I've seen solutions u开发者_C百科sing WinForms ( Get program icons ) , but how can I do this using WPF?

Also, due to the nature of the task, it needs to be done dynamically using C#, not with Xaml.

I appreciate any help!


The answer in that post is about WPF. It returns an ImageSource. WPF's Image class handles that just fine using the Source property.

someImage.Source = GetIcon(somePath); // See http://stackoverflow.com/questions/6008600/get-program-icons
0

精彩评论

暂无评论...
验证码 换一张
取 消