That is an interesting article.  I started working on some RB code to do
this, but I got stuck on the SetWindowsHookEx function.  Two of the
parameters is defined thusly:

hMod: Handle to the DLL containing the hook procedure pointed to by the lpfn
parameter.  The hMod parameter must be set to NULL if th dwThreadId
parameter specifies a thread created by the current process and if the hook
procedure is within the code associated with the current process.
dwThreadId: Specifies the identifier of the thread with which the hook
procedure is to be associated.  If this parameter is zero, the hook
procedure is associated with all existing threads running in the same
desktop as the calling thread.

Since my code isn't in a DLL, how do I give it a handle for the DLL?  I
tried passing in the window handle, but that didn't work.  So I tried
creating a thread and passing in the thread ID, with hMod set to 0, but that
didn't work either.

On 1/28/07, Tom Benson <[EMAIL PROTECTED]> wrote:

I always enjoy a challenge... hehe.

Although targeted towards VB rather than RB, this page contains most/
all of the declares for the Win32 environment  you need to capture
keyDown events for keys which do not generate ASCII codes.

http://www.codeguru.com/vb/gen/vb_system/keyboard/article.php/c4831/
#more

You may have to put this into a background thread which keeps
scanning the keyboard for input, unless you come up with a trigger
mechanism somehow. Maybe Win32 has an AppNotify eventHandler you can
hook, but I couldn't find out anything about it.

- Tom


On 29/01/2007, at 9:52 AM, Jim Dossey wrote:

> On Windows, The PrintScreen key doesn't generate a KeyDown event at
> all, so you can't call Keyboard.asyncKeyDown then to test for
> PrintScreen.
>
> On 1/21/07, Tom Benson <[EMAIL PROTECTED]> wrote:
>>
>> FWIW you can detect individual function key presses by testing
>> keyboard.asynckeydown in KeyDown events, and you could probably
>> extend this to test for the print screen key, which I believe is F16
>> (?) on windows.
>>
>> Therefore if you put this in your keydown event it should capture it
>>
>> > if Keyboard.asyncKeyDown(106) then
>> >       //F16 - (print screen) was pressed
>> >       return true
>> > end
>>
>> - Tom

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to