6 messages in net.java.dev.jna.usersRE: [jna-users] Create a Block hook w...
FromSent OnAttachments
Maxwell C. XandecoApr 23, 2008 9:25 am 
Timothy WallApr 23, 2008 12:13 pm 
Maxwell C. XandecoApr 23, 2008 12:59 pm 
Timothy WallApr 23, 2008 1:06 pm 
Daniel KaufmannApr 23, 2008 5:55 pm 
Maxwell C. XandecoMay 7, 2008 12:47 pm 
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] Create a Block hook with jnaActions...
From:Maxwell C. Xandeco (maxw@fit-tecnologia.org.br)
Date:May 7, 2008 12:47:37 pm
List:net.java.dev.jna.users

I change the:

return lib.CallNextHookEx(hhk, nCode, wParam, info.getPointer());

to

return new LRESULT(1);

And the original target of keyboard don't receive the event.

-----Original Message----- From: Timothy Wall [mailto:twal@dev.java.net] Sent: quarta-feira, 23 de abril de 2008 17:07 To: use@jna.dev.java.net Subject: Re: [jna-users] Create a Block hook with jna

Unfortunately, the code executed by WH_KEYBOARD must reside within a DLL due to the way that the windows OS accesses the callback. I don't know any more than that, since the MS docs are light on the details of exactly *why* that is the case, or what the specific software requirements are for successful callback execution. There might be a workaround, there might not.

On Apr 23, 2008, at 4:00 PM, Maxwell C. Xandeco wrote:

Timothy, I have a native app that blocks the keyboard ,but I not have the source code,I only need to process the data before calling the next hook

I found a jna example that blocks the keyboard on:

https://jna.dev.java.net/nonav/issues/showattachment.cgi/11/contributi on .zip

I realized that in this example the type of hook used is WH_KEYBOARD, on KeyHook example the type used is WH_KEYBOARD_LL, i tried the following change:

hhk = lib.SetWindowsHookEx(User32.WH_KEYBOARD, keyboardHook, hMod, 0);

But don't works form me,nothing happens after register the hook.

I think that changing the type WH_KEYBOARD_LL to WH_KEYBOARD solve the

problem, you have some idea of how the type WH_KEYBOARD work in the example KeyHook.

Thanks.... Maxwell

-----Original Message----- From: Timothy Wall [mailto:twal@dev.java.net] Sent: quarta-feira, 23 de abril de 2008 16:14 To: use@jna.dev.java.net Subject: Re: [jna-users] Create a Block hook with jna

Do you have a native example that works? If you're trying something entirely new and you're not sure how to do it, throwing JNA in the mix

just adds to the uncertainty if you're not already familiar with it.

On Apr 23, 2008, at 12:26 PM, Maxwell C. Xandeco wrote:

Hi,

I need to create a block keyboard hook on windows, i need to receive

the vkCode and validate, if pass i call the next hook, else i ignore the key.

I tried with the example of svn (KeyHook) but I could not, this example call the code java after windows proccess, i need to call before and validate.