Re: Previous Instance



"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


.



Relevant Pages

  • Re: Display a message each time functions are called
    ... This app is basically an e-Learning and content ... That does not sound like a problem with client-side scripting either. ... Not a client-side script problem either, unless there was a bug in the user ... very well for reporting: ...
    (comp.lang.javascript)
  • Re: pause simple but usefull
    ... than a C compiler that sees much heavier use (hence bug reports). ... I am of course speaking in the context of if more people would do asm and work together on it, this would safe time for them, and for their users. ... It is quite simple to make an app run correctly from a single directory, without ever toughing the registry and ect. ... Now try to imagine we download and install, something like may 10-100 apps a year, with updates and etc, and each spend from 10 seconds to several minutes just to install, some even spend the same amount of time to unistall. ...
    (alt.lang.asm)
  • Re: IOCP critical sections and mutexes
    ... then there is some bug in your ... routines but I recently started some preliminary stress test on a new server ... then pushes it in a queue that will be later processed by my main app ... If I use a mutex instead it works fine. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Errors: R6025 and Friends
    ... had a ->Releaseexecuted when the user clicked the X or closed the app some ... trying to run in the debugger. ... So I decided that I will run this program in Debug mode on the test server ... I would suggest that even thinking that reformatting a hard drive could fix a program bug ...
    (microsoft.public.vc.mfc)
  • Re: GIMP in Gutsy is a "release conadidate".
    ... This is a *major* app. ... unsupported backport. ... then *please* subscribe to this bug report. ... He is nowhere to be found and the bug is sitting ...
    (Ubuntu)