> Jeremy Coulter wrote:
> 
> Hi all.
> 
> Just fixing a bug in an app. I have written (for myself) and I cant seem
> to fix it.
> 
> Heres the problem.
> I have a form that on the Application.OnMinimize event gets sent to
> another procedure which then hides the form from the taskbar and displays
> an icon in the system tray.
> This works ok, BUT when I redisplay the form, I cant get teh focus back to
> the form. I.e. the Captionbar of the form is the colour of one that has
> lost the focus, and I cant access any of the controls on the form either !

It sounds like the problem is that your application isn't the currently
active process when you try to bring the window to the front.  If you are
running on Win98/ME/2K then it doesn't let you bring a window to the front
unless it belongs to the active process.  Instead it flashes the icon on the
task bar to let the user know that the application wants your attention.

I posted some code here recently that works around this by running the
restore code in the context of the current process.  If you want I'll repost
it... I think it'll solve the problem.

-- 
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur!"
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to