<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=ISO-8859-1>
<META content="MSHTML 6.00.2900.2668" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Right, thanks for that.
That's put me in the right direction. I think I'll just create a
dummy invisible form.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2>Ross.</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=KyleyHarris@gmail.com href="mailto:KyleyHarris@gmail.com">Kyley
Harris</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=delphi@ns3.123.co.nz
href="mailto:delphi@ns3.123.co.nz">NZ Borland Developers Group - Delphi
List</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, June 28, 2005 4:04
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Spam] Re: [Spam] Re: [Spam] Re:
[Spam] Re: [Spam] Re: [DUG] Interceptingmessagesin separateunits</DIV>
<DIV><BR></DIV>Yes. It is possible. The simplest method is to create a
TWincontrol. or a tform<BR><BR>ie TMyMessageForm = class(TForm)<BR><BR>
set the caption to
'MyMessageForm01'<BR><BR>findwindow('TMyMessageForm','MyMessageForm01') and
then do a sendmessage.<BR><BR>if you want to do this without creating a tform,
then you really need to analyze how the application, and the tforms create
handles, and <BR>allocate WndProcs to them, and use CreateParams features to
assign a classname, and windowname to the handle. <BR><BR>instead of
AllocateHWND there are a series of calls to winapi routines to create the
correct type of handle and then initialize window class parameters, and assign
a wndproc to it.<BR><BR>So It can be done, but it is a big win API topic that
is too big for here.<BR><BR>regards <BR><BR> Kyley<BR><BR>Ross
Levis wrote:
<BLOCKQUOTE cite=mid00bb01c57b93$ab367910$5100a8c0@levis4 type="cite">
<META content="MSHTML 6.00.2900.2668" name=GENERATOR>
<DIV><FONT face=Arial size=2>This is a different excercise to the original
problem. I've solved that by sending the handle to the
DLL.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>For this next exercise, imagine an
external executable which only knows the Windows class name of myr
application. The other executable does a FindWindow to obtain the
handle of my application and then uses this for SendMessage.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>I want to be able to receive and process these
messages inside a component in my application. Is this
possible?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Cheers,</FONT></DIV>
<DIV><FONT face=Arial
size=2>Ross.</FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>