3 messages in net.java.dev.jna.usersRe: [jna-users] SetWinEventHook
FromSent OnAttachments
Daniel BechterMar 19, 2008 8:23 am.java, .java, .java
Timothy WallMar 19, 2008 8:32 am 
Daniel BechterMar 19, 2008 9:02 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] SetWinEventHookActions...
From:Timothy Wall (twal@dev.java.net)
Date:Mar 19, 2008 8:32:44 am
List:net.java.dev.jna.users

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