>I have written an 2 executables. One is an ActiveX client, One is the ActiveX server. I use WinAPI calls to ensure that each program can be run only once and if the exe is already runnning BringWindowToTop.
>
>1) Start MyClient.EXE
>2) MyClient.EXE instantiates the object Model of Myserver.EXE by creating the Myserver.EXE Application object.
>3) MyClient.EXE uses a services of MyServer.EXE oAPp.DoSomething
>4) MyClient.EXE destroys Myserver.EXE App Object
>5) MyClient.EXE does not end up with Windows Focus.
>
>While Destroying Myserver.exe I call BringWindowToTop
>Once Destroyed MYClient.EXE tries callilng BringWindowToTop
>
>In development mode the code has no problem finding MyClient and giving it focus. This only happens in EXE's.
>
>How do I get focus back to MyClient.EXE?
Terry,
I am not sure why you are seeing this. On first glance, BringWindowToTop and SetForegroundWindow seem to do similar things. However, I have never used BringWindowToTop so I have no direct experience with it. You could try SetForegroundWindow instead and see if the results are teh same.
HTH.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao