🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.language.objectpascal
Article #30

Re: Capture Keyboard - Key Dump

#30
From: 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
Technical Details
Message-ID: <10onhj0nqvgvpfd@corp.supernews.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed.mathworks.com!arclight.uoregon.edu!hammer.uoregon.edu!logbridge.uoregon.edu!tethys.csu.net!nntp.csufresno.edu!sn-xit-03!sn-xit-08!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
References: <79d8d5b3.0411042031.539bf464@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 109d30,e402b0fc39255682
X-Google-Thread: 1091e5,e402b0fc39255682
X-Google-Thread: fd817,e402b0fc39255682
X-Google-Thread: 140b35,e402b0fc39255682
X-Google-Attributes: gid109d30,gid1091e5,gidfd817,gid140b35,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed.mathworks.com!arclight.uoregon.edu!hammer.uoregon.edu!logbridge.uoregon.edu!tethys.csu.net!nntp.csufresno.edu!sn-xit-03!sn-xit-08!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
From: Jamie <jamie_5_not_valid_after_5_Please@charter.net>
Newsgroups: borland.public.delphi.language.objectpascal,borland.public.delphi.winapi,alt.comp.lang.borland-delphi,borland.public.delphi.language.delphi.win32
Subject: Re: Capture Keyboard - Key Dump
Date: Fri, 05 Nov 2004 13:55:39 -0800
Organization: Posted via Supernews, http://www.supernews.com
Message-ID: <10onhj0nqvgvpfd@corp.supernews.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
References: <79d8d5b3.0411042031.539bf464@posting.google.com>
In-Reply-To: <79d8d5b3.0411042031.539bf464@posting.google.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@supernews.com
Lines: 33