TIP: Click on subject to list as thread! ANSI
echo: delphi
to: OLE ALMIND MORTENSEN
from: GARY WEINFURTHER
date: 1997-04-10 07:15:00
subject: How to trap keypress

Ole Almind Mortensen mentioned this to All:
 OAM> I need to know how to trap all keystrocks in Windows (Delphi 2.0), also
 OAM> when my program hasn't got focus, please help. :)
You have to install a keyboard hook using a DLL.  It's not pretty.  See the 
SetKeyboardHook API function.  And note that 32 bit DLLs do not share their 
data between applications.  So you also have to make use of memory-mapped 
files to store your hook handles and other information.
                                ...Gary
--- GoldED 2.41
---------------
* Origin: Nobody expects the Flying Circus BBS! (1:2410/905)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.