I have an ActiveX EXE (written in VB6) that has worked fine on Windows 2000
and XP. When invoked, the calling application can call a method that has the
ActiveX EXE display a dialog box.
The problem is that on Vista, the dialog box ALWAYS appears behind the
current running application, not in front of it. On all previous OS's the
dialog box always appeared in the front.
I so far have not found any easy way to bring the dialog to the front. It
seems that because it is running in another process, that process isn't being
given the focus, even though it was created by the process that currently has
the focus.
I really need to resolve this issue fast!!!! (and yes, I have tried calling
BringWindowToTop, setForegroundWindow and other similar win api calls)
I was able to get it to work by passing the window handle from the ActiveX
EXE object back to the caller and have the caller call SetForegroundWindow.
But to implement this would require rewriting all the applications that call
this object and that is just not possible at this time!

Signature
Scott McBurney
Software Developer
LexisNexis
Scott McBurney - 21 Sep 2007 18:34 GMT
I should also mention, the dialog being show is a Modeless dialog, so it is
not blocking the original calling process.

Signature
Scott McBurney
Software Developer
LexisNexis
--
Scott McBurney
Software Developer
LexisNexis
> I have an ActiveX EXE (written in VB6) that has worked fine on Windows 2000
> and XP. When invoked, the calling application can call a method that has the
[quoted text clipped - 16 lines]
> But to implement this would require rewriting all the applications that call
> this object and that is just not possible at this time!
Karl E. Peterson - 21 Sep 2007 21:05 GMT
> I was able to get it to work by passing the window handle from the ActiveX
> EXE object back to the caller and have the caller call SetForegroundWindow.
> But to implement this would require rewriting all the applications that call
> this object and that is just not possible at this time!
So the goal is to just "fix" it in the axEXE?
> I really need to resolve this issue fast!!!! (and yes, I have tried calling
> BringWindowToTop, setForegroundWindow and other similar win api calls)
Maybe try the technique here? http://vb.mvps.org/samples/ForceFore
I'd be very interested to hear if that works.

Signature
.NET: It's About Trust!
http://vfred.mvps.org
Jan Hyde (VB MVP) - 12 Oct 2007 12:59 GMT
"Karl E. Peterson" <karl@mvps.org>'s wild thoughts were
released on Fri, 21 Sep 2007 13:05:33 -0700 bearing the
following fruit:
>> I was able to get it to work by passing the window handle from the ActiveX
>> EXE object back to the caller and have the caller call SetForegroundWindow.
[quoted text clipped - 9 lines]
>
>I'd be very interested to hear if that works.
Assuming it's the same ForceFore code I used then it does
appear to work. At least it works on my PC and support calls
reporting this problem have stopped ;-)
--
Jan Hyde
https://mvp.support.microsoft.com/profile/Jan.Hyde
Karl E. Peterson - 18 Oct 2007 23:44 GMT
> "Karl E. Peterson" <karl@mvps.org>'s wild thoughts were
> released on Fri, 21 Sep 2007 13:05:33 -0700 bearing the
[quoted text clipped - 17 lines]
> appear to work. At least it works on my PC and support calls
> reporting this problem have stopped ;-)
Very cool. :-)

Signature
.NET: It's About Trust!
http://vfred.mvps.org