I believe you have to set up a dedicated message handling loop in
order to see any messages. See the low-level keyboard hook example in
the contrib directory. Even though no events are processed in the
loop (GetMessage never returns), without the call no events are ever
seen.
I don't know enough about w32 internals to know what's going on.
You'd think that the VM's message processing loop would be sufficient.
On Mar 19, 2008, at 11:23 AM, Daniel Bechter wrote:
Dear mailing list,
I have already managed to successfully call some Win32 User32
functions.
But I could not yet manage to receive Events. I need the "foreground
window changed event". I am calling the function SetWinEventHook in
the
user32.dll and hand a WinEventProc callback into the function.
Somehow I
fail to receive the event. No exceptions however...
I have just attached the code (containing only this very problem,
nothing else):
Main.java: defines the callback and sets it
User32.java: declares user32 functions (set, unset hook) and callback
Win32TypeLib: defines types HANDLE, HWND, HWINEVENTHOOK
Hope somebody can help me.
<<Main.java>> <<User32.java>> <<Win32TypeLib.java>>
<
Main
.java
<
User32
.java
<
Win32TypeLib
.java
---------------------------------------------------------------------
To unsubscribe, e-mail: user...@jna.dev.java.net
For additional commands, e-mail: user...@jna.dev.java.net