Re: Previous Instance
- From: Tom Esh <tjeshGibberish@xxxxxxxxxx>
- Date: Sun, 15 May 2005 17:11:43 -0400
On Sun, 15 May 2005 20:20:24 +0100, "Lindsay" <me@xxxxxxxx> wrote:
>
>I found some code in the API-Guide using DdeConnect which works well but has
>a bug. When you click the icon a second time, although the first instance
>becomes visible, I cannot get it to be the foreground window. 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.
Sounds like the foreground lock at work. I would not recommend
changing it since messing about with user settings is almost always a
bad idea. IMO a better way is demonstrated in the "ForceFore" example
on Karl Peterson's site: http://vb.mvps.org/
While you're there, also check out the "PrevInst" example. It
demonstrates a technique for communicating between instances.
-Tom
MVP - Visual Basic
(please post replies to the newsgroup)
.
- References:
- Previous Instance
- From: Lindsay
- Previous Instance
- Prev by Date: Re: Previous Instance
- Next by Date: Re: CryptGetUserKey is failing on one PC but not the other.
- Previous by thread: Re: Previous Instance
- Next by thread: Re: Previous Instance
- Index(es):
Relevant Pages
|