I think orginally it took me 2 days to figure this out.
AliR.
It always amazes me that we have to go through these steps (in this
order), but that works for me too so I usually just create my own function
like:
void MyWindowToTop(CWnd *pWnd)
{
pWnd->SetForegroundWindow();
pWnd->BringWindowToTop();
pWnd->SetActiveWindow();
}
Kind of a no-brainer, but at first I spent a lot of time monkeying around
with each of the calls and none worked, then when I tried them together
they did.
Tom
"AliR (VC++ MVP)" <AliR@online.nospam> wrote in message
news:Ij1qj.5981$Ch6.2692@newssvr11.news.prodigy.net...
I have been successful with this combination in the past.
pWnd->SetForegroundWindow();
pWnd->BringWindowToTop();
pWnd->SetActiveWindow();
AliR.
"Olivier" <toon@toonworld.com> wrote in message
news:%2335BJ2BaIHA.4196@TK2MSFTNGP04.phx.gbl...
Hello,
Our product A (which is a MFC exe) acts as an add-on for a product B
(which is another exe)
Product B cooperates through the COM interface of our product
One of commands available in product B allows user to switch to our
product (i.e our product must pop up above product B's window, thus
allowing user to select some data in our product).
This is an essential command for our product...
We have implemented this by using CWnd::SetForegroundWindow() but, of
course, this does not work on Windows 2000 and above (I know about
limitation of SetForegroundWindow() since Win2k)
How could we achieve the same result as with SetForegroundWindow()?
I found some tricks using AttachThreadInput() but I'm uncomfortable with
this solution because my feeling is this latter is bad to do what we
need.
Is there another option?
Thanks in advance.
Olivier.