Re: Previous Instance
- From: "Michael C" <mculley@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 16 May 2005 10:17:37 +1000
"Lindsay" <me@xxxxxxxx> wrote in message
news:4287a124$0$39068$ed2e19e4@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> I found some code in the API-Guide using DdeConnect which works well but
> has a bug.
DDE is outdated and probably should be avoided.
> When you click the icon a second time, although the first instance becomes
> visible, I cannot get it to be the foreground window.
This is not a bug, it's a feature in win2k and XP that stops adds poping to
the foreground
> It will be active but have no keyboard focus. All APIs have failed trying
> to give it focus. It seems the window with the icon keeps the focus. If
> the first instance is minimized (i.e. at the bottom of the z-order) and
> you have other windows visible, when the app becomes visible, it remains
> at the bottom of the z-order. I could use SetWindowPos to get it to the
> top, but it still doesn't have keyboard focus.
>
> Any ideas?
Goto www.buygold.net and have a look at one of the tips of the month that
should solve your problems, called Forward Command Line. It is designed to
pass on the command line args to the previous instance of the app but you
could modify it to pass anything you wanted. It also gets around the
foreground problem by having the new instance of your app bring the previous
instance to the front (the foreground app is permitted to do this but the
background app can't bring itself to the front).
Michael
.
- References:
- Previous Instance
- From: Lindsay
- Previous Instance
- Prev by Date: how to tell the service my account is login
- Next by Date: I need a MouseOff event!
- Previous by thread: Re: Previous Instance
- Next by thread: how to tell the service my account is login
- Index(es):
Relevant Pages
|