TWatch -
Register -
TKeyInfo
TKeyNativeEvent
TSetReceiver
TShellEvent
TStillWatching
TStopAll
TWatching
TWatchType
watchdll
procedure Register;
TKeyInfo = record
RepeatCount : Integer;
ScanCode : Integer;
Extended : Boolean;
AltDown : Boolean;
PreviousDown : Boolean;
Down : Boolean;
KeyNameText : String;
end;
not yet implemented
TKeyNativeEvent=procedure( Sender:TObject;
wParam,lParam:Integer) of Object
TSetReceiver=procedure(r:Integer)
TShellEvent=procedure( Sender:TObject;
Handle:THandle;
AppName:String) of Object
procedures for events
TStillWatching=function:Boolean
TStopAll=procedure
TWatching=procedure(WatchType:TWatchType)
procedures in the dll
TWatchType=( wtSHELL,wtKEYBOARD, //implemented
wtCALLWNDPROC,wtGETMESSAGE, //not yet implemented
wtMOUSE,wtMSGFILTER,wtSYSMSGFILTER);
watchdll = 'watching.dll'
The TWatch Component V1.0
MOST IMPORTANT :)
=================
This is NOT Freeware: It's PostCardWare. When you use
this component or think it's useful, send me a post-card
to: Florian Bömers, Werderstr.31, D - 68165 Mannheim, Germany
And of course, I am very interested in any application
that uses this component (or any other application you wrote).
If so, mail me (not the program, just an URL or similar) !
(mail address below)
Installation:
=============
1. Copy the File PathDialog.pas to the directory where
you store your components (or let it where it is)
2. The library watching.dll must be in the search path or in
the directory of the program you created. It is loaded and
unloaded dynamically when needed, in order to prevent Delphi
to load it when installing the component.
3. In Delphi, select Component|Install Component. In the
following dialog enter the path and filename of
Watch.pas and hit OK.
4. Now the Watch Component is available in the
Component palette under Samples.
Description
===========
This component enables you to track some system events.
Currently implemented are Shell events (i.e. Activation,
Creation, Closure of Applications) and Keyboard events.
The shell events have one drawback: The name parameter is
identical for all instances of a watched program. You
can only use the Handle parameter of the event to distinguish
different instances of the same application.
How to use it
=============
Properties:
- NotifyOwnEvents: Whether an event shall be sent when
the own application receives a shell event
- RepeatedEvents: When you activate different windows
of the same application, each time an
event is sent. If you set this to false,
only the first event will be sent.
Events:
I think, they do what they're named (?!)
ideas for enhancements:
- of course, add the other hooks
- use toAscii in order to get an Ascii-Character of a key
- let the dll get some information about the window
in which are typed the keys
- possibility to change messages
- let the dll change specific things while in context
of another program e.g. add to every menu an own menu...
or just get some information about that program
Copyright
=========
(c) 1997 by Florian Bömers
send any comments, proposals, enhancements etc. to:
fbomers@erato.unice.fr
(if this address does not work: boemers@rumms.uni-mannheim.de)