You can’t.
While in native Win32 various handles are basically an integer type, they are not pointers and they are not really indexes, and you are not suppose to brute force unhooking the way you are trying to do.
In any case, in the JNA, the HHOOK type is an object, and it has no API for creating one from in type.
I am not sure what you are trying to do, but you should save any HHOOK you receive from SetWindowsHookEx
, and only call UnhookWindowsHookEx
on those objects.
2
solved Java JNA: How cast integer (int) to HHOOK?