Re: Bring my application to top
No I tried something near to that, but missed the SetActiveWindow()
I will test it tomorrow.
--
Laurs Laursen
"AliR (VC++ MVP)" wrote:
Have you tried this:
CWnd *pWnd = AfxGetMainWnd();
if (pWnd)
{
pWnd->SetForegroundWindow();
pWnd->BringWindowToTop();
pWnd->SetActiveWindow();
}
AliR.
"Laurs" <Laurs@discussions.microsoft.com> wrote in message
news:9A3B28A8-CB26-49B6-8272-4B3A53A3D4CC@microsoft.com...
When I call a subprogram from my mfc MDI application with
CreateProcess(...) and wait for the return with
if(WaitForSingleObject(hpccmd, INFINITE) != WAIT_FAILED) {
The focus often not goes to my application but to the last program on top
before the application was started (could be Excell or MS Visual or
AutoCad)
(My application is mostly maximized when it runs)
So what I need is a safe BringApplicationToTop() in its last postion and
size
---
Laurs Laursen