Re: Bring top-level window to the front
From: Janusz (erfan_at_poczta.onet.pl)
Date: 09/28/04
- Next message: Sigurd Stenersen: "Re: Alternate to while loop in threads - help please"
- Previous message: Norm Dresner: "Re: How to export this function from my dll?"
- In reply to: Ruben Jönsson: "Re: Bring top-level window to the front"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 28 Sep 2004 13:20:20 +0200
> void CMFCHelper::ActivateAndShowWnd(CWnd *pWnd)
> {
> DWORD tMe,tTop;
>
> tMe=GetCurrentThreadId();
> tTop=GetWindowThreadProcessId(GetForegroundWindow(),NULL);
> if (tMe!=tTop){
> AttachThreadInput(tTop,tMe,TRUE);
> pWnd->SetForegroundWindow();
> pWnd->SetFocus();
> AttachThreadInput(tTop,tMe,FALSE);
> } else {
> pWnd->SetForegroundWindow();
> pWnd->SetFocus();
> }
> }
>
> Regards / Ruben
Thanks, I found this function some time ago in the net but it also failed to
do what I need.
For those who are interested, here's the tip:
The SetForegroundWindow description in the MSDN explains why it is so hard
to bring any window to the top and how it can be achived (the only problem
is that it works only for WINVER >= 5.0)
Best
Janusz
- Next message: Sigurd Stenersen: "Re: Alternate to while loop in threads - help please"
- Previous message: Norm Dresner: "Re: How to export this function from my dll?"
- In reply to: Ruben Jönsson: "Re: Bring top-level window to the front"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|