Re: Setting up a TMessage trap
- From: Jamie <jamie_ka1lpa_not_valid_after_ka1lpa_@xxxxxxxxxxx>
- Date: Sun, 30 Mar 2008 11:56:17 -0500
battles wrote:
I have a program that is using a timer to scan and determine ifYou need to run a windows Hook "SetWindowsHookEx" in a DLL file.
another program has started. I would like to get away from using a
timer. Is there possibly a message trap I could set up to look for
certain messages, such as WM_CREATE, whereby I could upon encountering
do the above scan for the other program. An example would be
appreciated.
Thanks.
That way, you can monitor create messages from where ever.
P.S.
It needs to be in a DLL and to send notices back to your own
program, you need use a mapped file that you can open to obtain
a window handle that you stored there when your app started up
of your main window. There You can use the postMessage with a
user+xxxx
etc..
if you don't want to use a mapped file, you could use a shared
memory segment to hold the handle of your app. The reason for this
is when you receive a message from another app, your DLL isn't really
in your app's process space and using the FindWIndow to search for your
app isn't really good because it can get confused with commonly used names of other windows already running.
Last time I checked, delphi isn't able to create a DLL with a shared
segment how ever, if you have a C compiler, you can do it with that and
use the DLL in delphi.
or, You could use the shared Memory lib that Delphi has if that makes it easier for you.
http://webpages.charter.net/jamie_5"
.
- Follow-Ups:
- Re: Setting up a TMessage trap
- From: battles
- Re: Setting up a TMessage trap
- References:
- Setting up a TMessage trap
- From: battles
- Setting up a TMessage trap
- Prev by Date: Re: Setting up a TMessage trap
- Next by Date: Re: Setting up a TMessage trap
- Previous by thread: Re: Setting up a TMessage trap
- Next by thread: Re: Setting up a TMessage trap
- Index(es):
Relevant Pages
|