[DUG] Applicarion.ProcessMessage

Ross Levis ross at stationplaylist.com
Tue Oct 29 19:27:38 NZDT 2013


I did go from Delphi 5 to Delphi 7 some time ago, but that's it.

 

From: delphi-bounces at listserver.123.net.nz
[mailto:delphi-bounces at listserver.123.net.nz] On Behalf Of Pieter De Wit
Sent: Tuesday, 29 October 2013 7:13 p.m.
To: delphi at listserver.123.net.nz
Subject: Re: [DUG] Applicarion.ProcessMessage

 

On 29/10/2013 17:02, Ross Levis wrote:

I'm wondering if any experts out there can help with this issue.

 

I'm loading a 3rd party DLL which needs to have Windows messages sent to the
DLL from my app for navigation purposes.  It has been 10 years since I
implemented this code which someone else gave me...

 

procedure TEngine.ProcessMessage(var Msg: tagMSG; var Handled: Boolean);

begin

  if not IsChild(Engine.Handle,Msg.hwnd) then

  try

    Handled := IsDialogMessage(GetParent(msg.hwnd),Msg);

  except

    Handled := False;

  end;

end;

 

Application.OnMessage := ProcessMessage;

 

Without this the DLL GUI would not show which component had the focus, which
was a problem for blind users using the tab key.

 

The problem:  When the DLL is doing something that takes several seconds,
the function above appears to hang waiting for the DLL to finish, and this
causes the main thread in my app to also hang.

 

Is there any way around that, such as using a separate thread to process
these messages?  That would be somewhat out of my league.

 

Cheers,

Ross. 

 






_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at listserver.123.net.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at listserver.123.net.nz with
Subject: unsubscribe

Hi,

Have you changed Delphi Versions ? (10 years is a long time :) )

Cheers,

Pieter

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20131029/6416d66a/attachment.html 


More information about the Delphi mailing list