如果我知道Hwnd,那么我怎么能够接手申请?
利用WinAPI实现与运行申请相关的icon
原标题:Getting the icon associated with a running application using WinAPI
问题回答
如果你能够处理窗户,你可使用。 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。
相关问题
热门标签
- winforms
- combobox
- fogbugz
- java
- date
- internationalization
- asp.net
- iis
- url-rewriting
- urlrewriter
- c#
- enums
- ocaml
- haxe
- algorithm
- string
- viewstate
- .net
- c++
- c
- symbol-table
- mysql
- database
- postgresql
- licensing
- migration
- vb.net
- vb6
- declaration
- vb6-migration
- python
- psycopg2
- backup
- vmware
- virtualization
- gnu-screen
- authentication
- desktop
- excel
- xll
- cultureinfo
- regioninfo
- oracle
- client
- session
- download
- html
- virtual
- constructor
- scenarios
- perl
- full-text-search
- javascript
- ajax
- testing
- oop
- inheritance
- vim
- encapsulation
- information-hiding