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 Rooks
Software Systems Architect
Microsoft Certified Solution Developer.Net
If at first you don't succeed, then skydiving definitely isn't for you.