English 中文(简体)
利用WinAPI实现与运行申请相关的icon
原标题:Getting the icon associated with a running application using WinAPI
  • 时间:2009-09-25 17:12:54
  •  标签:

如果我知道Hwnd,那么我怎么能够接手申请?

问题回答

如果你能够处理窗户,你可使用。 GetClassLong:

HICON icon = (HICON)GetClassLong(window, GCL_HICON);

I you have the hwnd you can get the process ID by using the WINAPI GetWindowThreadProcessId. With that you can create a C# Process object. Next, you can iterate through the process ProcessModule Collection to get the filename of the executable. Finally, you can use the WINAPI function ExtractIconEx to get the icon from the path

Pinvoke有关于“妇女促进平等”两种方法的资料。

http://www.pinvoke.net/default.aspx/shell32/ExtractIconEx.html





相关问题
热门标签