How to get Java app icon?

I have code that displays a running application in a win32 window and then displays their icons.

So far so good, I get hwnd applications and then call GetClassLong (hwnd, GCL_HICONSM) and everything is fine.

But the case with java applications is a pain that I have to deal with, since the process that answers my calls is javaw.exe, and not a brilliant java application that received a beautiful icon ...

I also took a picture in GetWindowThreadProcessId, but, alas, this is the PID of javaw, which returned ...

There is a way to do this, since the task manager (alt + tab) displays a nice icon.

+3
source share
2 answers

Mmm, , Process Viewer , ( Java). , , ...: - (

ProcMon Sysinternals , .

...: -)

[EDIT] MS KB WM_QUERYDRAGICON GCL_HICON ...

+3

, PhiLho, : Codeproject , ( java ):

// :

SendMessageTimeout (WM_GETICON)

// ,

GetClassLong (GCL_HICONSM)

// ,

SendMessageTimeout (WM_WM_QUERYDRAGICON)

// , , void

- java , , , -, javaw.exe.

PhiLho.

+5

Source: https://habr.com/ru/post/1698403/


All Articles