>>I have an executable file lanuched from another application.
>>is there a way to make thie executable file foreground if it is launched
[quoted text clipped - 5 lines]
>
> and read the remarks section for the caveats.
> Thanks for the help.
You are welcome.
> I also find the function SetForegroundWindow().
It works on '95 and NT4. It has been intentionally crippled on 98/Me/2K/XP
and 2K+3.
> My problem is that a1.exe launches a2.exe, and then a2.exe
> launches a3.exe.
> However, a3.exe cannot be displayed immediately.
> Only after a2.exe is terminated, then a3.exe then can be displayed.
> I think SetForegroundWindow() or SwitchToThisWindow() might be helpful,
> but I am not sure if I should put this function in a3.exe or a2.exe?
If you must, try calling SwitchToThisWindow() in a3 passing the handle of
its main window.
Note that many people, including me, will immediately uninstall an
application which "steals" the forreground. The bad behavior of so many
applications that did this is the reason why SetForegroundWindow() has been
crippled and why SwitchToThisWindow() is on its way out.
Regards,
Will
one2001boy@yahoo.com - 20 Mar 2005 21:43 GMT
>>Thanks for the help.
>
[quoted text clipped - 19 lines]
> applications that did this is the reason why SetForegroundWindow() has been
> crippled and why SwitchToThisWindow() is on its way out.
I have an applicaiton a1.exe calls a2.exe, a2.exe calls a3.exe.
I have to kill a1.exe and then a3.exe will run.
I added SwitchToThisWindow() on a3.exe, I still need to kill a1.exe to
get a3.exe to run. Not sure how to fix this problem.
If used notepad.exe to
replace a3.exe, I find that I can run a3.exe without the need to kill
a1.exe.
Not sure if there are some tricks over there?
Thanks.
> Regards,
> Will