🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.language.objectpascal
3 messages
3 total messages Started by JoeAley2003 Fri, 05 Nov 2004 04:31
Capture Keyboard - Key Dump
#28
Author: JoeAley2003
Date: Fri, 05 Nov 2004 04:31
20 lines
1545 bytes
Hi all...


 I need to write a simple software that writes to a Memo all the
characters typed on the keyboard.
 
 So, as it is system wide, and it must run on winnt platafform, i
cannot read the port using asm for example.

 How would you do that?  

 Keep a timer selecting the active window and than i don't know how
capture the key???

 Can you show the complete code or the algorithm with some functions
examples?

 I have searche on the net a lot and had no success... 

 Thanks
Re: Capture Keyboard - Key Dump
#30
Author: Jamie
Date: Fri, 05 Nov 2004 21:55
32 lines
2432 bytes
have a look at SetWindowsHookEx. in the WIn32 API help.
you will need to make a DLL that does the actual hooking
so that all Apps will have it mapped in..
  then you can use the FindWindow in the DLL each time
the callback is referenced to locate your app window, this
will return a handle that you can use to post a user message to.
  P.S.
    make sure you use some exotic name for your form class to insure
there is no mix up in using the findWIndow Api call.


JoeAley2003 wrote:
> Hi all...
> 
> 
>  I need to write a simple software that writes to a Memo all the
> characters typed on the keyboard.
>  
>  So, as it is system wide, and it must run on winnt platafform, i
> cannot read the port using asm for example.
> 
>  How would you do that?  
> 
>  Keep a timer selecting the active window and than i don't know how
> capture the key???
> 
>  Can you show the complete code or the algorithm with some functions
> examples?
> 
>  I have searche on the net a lot and had no success... 
> 
>  Thanks
Re: Capture Keyboard - Key Dump
#31
Author: Martin Harvey (Demon account)
Date: Sat, 06 Nov 2004 03:00
20 lines
2220 bytes
On Fri, 05 Nov 2004 13:55:39 -0800, Jamie
<jamie_5_not_valid_after_5_Please@charter.net> wrote:

>have a look at SetWindowsHookEx. in the WIn32 API help.
>you will need to make a DLL that does the actual hooking
>so that all Apps will have it mapped in..
>  then you can use the FindWindow in the DLL each time
>the callback is referenced to locate your app window, this
>will return a handle that you can use to post a user message to.
>  P.S.
>    make sure you use some exotic name for your form class to insure
>there is no mix up in using the findWIndow Api call.

There's a better way, which is to use a global named mutex and global
named memory mapped file.

And by the way - setting this kind of global system hook will be
caught by every virus scanner under the sun... I know.

MH.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads