Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2008 Feb : Trying to get app A to update app b with messages

www.cryer.info
Managed Newsgroup Archive

Trying to get app A to update app b with messages

Subject:Trying to get app A to update app b with messages
Posted by:"Matthew Augier (dps)" (matth..@dps.uk.com)
Date:Fri, 8 Feb 2008 18:21:16

I am having a problem trying to get my main application to update a
secondary app with status messages.
Application A runs several things, and during one of these (robotic
movements), I send a message to my secondary application to show that it's
waiting for the robitcs to take place. The mesasge has a parameter of +1
or -1 (+1 is starting -1 completed), so application 2 knows if it should
hide the status information window. Everything works great, except for the
fact that application 2 keeps stealing the focus, which is a real pain when
you are typing!

I've tried to add all sorts of code to stop this

ExtendedStyle := GetWindowLong(Application.Handle, GWL_EXSTYLE);
SetWindowLong(Application.Handle, GWL_EXSTYLE, ExtendedStyle OR
WS_EX_TOOLWINDOW AND NOT WS_EX_APPWINDOW);
Application.CreateForm(TWorkingForm, WorkingForm);
Application.ShowMainForm := False;

procedure TWorkingForm.ShowNA;
Begin
   ShowWindow( handle, SW_SHOWNA );
   Visible := true;
End;

(Used instead of show) - but I jst can not seem to get this window to show
and hide without stealing the focus.

Any advice or fixes welcome!

Mat

Replies:

www.cryer.info
Managed Newsgroup Archive