Getting the icon associated with a running application

后端 未结 2 1515
执笔经年
执笔经年 2020-12-30 14:47

Having the window handle for an open application, I\'m able to use the GetWindowText function to retrieve the text from the title bar of the app. I would like to take this

2条回答
  •  借酒劲吻你
    2020-12-30 14:48

    Icon ico = Icon.ExtractAssociatedIcon(theProcess.MainModule.FileName);
    

    From TheSoftwareJedi

    Initially this appears to be an exact duplicate of How can I get the icon from the executable file only having an instance of it's Process in C# but that one seems to focus largely on how to get it from within it's own self, whereas you may be asking how to get the icon using a program separate from the running process.

    -Adam

提交回复
热议问题