Re: Setting up a TMessage trap



"battles" <battles@xxxxxxxxxxxxxx> wrote in message
news:dfa11a8e-7fbe-454d-96b9-d9d601f5c121@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I have a program that is using a timer to scan and determine if
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.

If you have source control over the other program, then there are
many easier ways. So I'll assume you don't.

Messages weren't primarily introduced to warn _other_ processes of
things that don't concern them as such, so while there are messages
for repainting and so on, I don't expect a global notification when
any random executable is started, nor do I in fact know of such a
message.

Hooking CreateProcess (and perhaps a few others) would seem to
come in at the exact place you want to, but it's not for the faint
of heart.

Examples through Google.

Groetjes,
Maarten Wiltink


.



Relevant Pages

  • Re: flickering subform
    ... it was a false alarm. ... I deleted the clock and all the code and reseted the ... >Any timer events running? ... >> repainting the ...
    (microsoft.public.access.formscoding)
  • Setting up a TMessage trap
    ... I have a program that is using a timer to scan and determine if ... Is there possibly a message trap I could set up to look for ... certain messages, such as WM_CREATE, whereby I could upon encountering ...
    (comp.lang.pascal.delphi.misc)