<!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></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Thanks for that Kyley.&nbsp; I managed to implement 
AllocateHWnd etc, and everything appears correct and logical.&nbsp; It's picking 
up some Windows messages but not the WM_USER messages being sent.&nbsp; WM_USER 
is message number 1024.&nbsp; I'm getting Message.Msg =&nbsp;28 and that's about 
it.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I tried the same code&nbsp;in the mainform as a 
test and this worked but only after I specified the following:</FONT></DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>procedure MyMessage(var Message: TMessage); message 
WM_USER;</FONT></DIV>
<DIV>&nbsp;</DIV></FONT></DIV>
<DIV><FONT face=Arial size=2>If I leave off "message WM_USER", then nothing gets 
through to the procedure in the mainform at all.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I tried this in the unit and it doesn't make any 
difference.&nbsp; Message 28 is still getting to the procedure and no 
1024.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>You can tell I'm no expert when it comes to 
this.&nbsp; Do I need to use your fancy looking wrapper class?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I must be missing something.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</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> Monday, June 27, 2005 7:13 PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [Spam] Re: [DUG] Intercepting 
  messages in separate units</DIV>
  <DIV><BR></DIV>in the forms unit<BR><BR>function AllocateHWnd(Method: 
  TWndMethod): HWND; deprecated;&nbsp; { moved to Classes.pas }<BR>{$EXTERNALSYM 
  AllocateHWnd}<BR>procedure DeallocateHWnd(Wnd: 
  HWND);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  deprecated;&nbsp; { moved to Classes.pas }<BR><BR><BR>read the help will sort 
  you out just fine<BR><BR>Ross Levis wrote: 
  <BLOCKQUOTE cite=mid014401c57ae7$48177ca0$5100a8c0@levis4 type="cite">
    <META content="MSHTML 6.00.2900.2668" name=GENERATOR>
    <STYLE></STYLE>

    <DIV><FONT face=Arial size=2>I'm writing a component which communicates with 
    a 3rd party DLL using WM_USER messages.&nbsp; After loading the DLL, 
    I&nbsp;need to tell&nbsp;the DLL the handle to send user messages back to, 
    so my unit can intercept them, but I don't know where to get a handle 
    from.&nbsp; I know how to do it in the mainform of a program but not in a 
    separate unit.&nbsp; The messages sent to the mainform do not appear to 
    reach my unit.</FONT></DIV>
    <DIV>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>What do I need to do to make this 
    happen?</FONT></DIV>
    <DIV>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2><FONT color=#000000>Thanks,</FONT></FONT></DIV>
    <DIV><FONT face=Arial size=2><FONT color=#000000>Ross.</FONT></FONT></DIV><PRE wrap=""><HR width="90%" SIZE=4>
_______________________________________________
Delphi mailing list
<A class=moz-txt-link-abbreviated href="mailto:Delphi@ns3.123.co.nz">Delphi@ns3.123.co.nz</A>
<A class=moz-txt-link-freetext href="http://ns3.123.co.nz/mailman/listinfo/delphi">http://ns3.123.co.nz/mailman/listinfo/delphi</A>
  </PRE></BLOCKQUOTE>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>Delphi mailing 
  list<BR>Delphi@ns3.123.co.nz<BR>http://ns3.123.co.nz/mailman/listinfo/delphi<BR></BLOCKQUOTE></BODY></HTML>