How to bring my dialog to top most? 
Author Message
 How to bring my dialog to top most?

Dear VC guru,

I have my application to perform certain monitor jobs. The application is
single dialog based. On certain condition, if the application's dialog is
minimized or covered by other application, I want to bring to top most.

I use following code:

  ::SetWindowPos(m_hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_SHOWWINDOW |
SWP_NOMOVE | SWP_NOSIZE);

But the problem is that the dialog's style become to TOP MOST, it cannot be
covered by other application. That's not what I want. So how to only bring
the dialog to top most?

Thanks in advance!
evan



Mon, 12 Sep 2005 06:40:26 GMT  
 How to bring my dialog to top most?

Quote:
>I have my application to perform certain monitor jobs. The application is
>single dialog based. On certain condition, if the application's dialog is
>minimized or covered by other application, I want to bring to top most.

Evan,

SetForgroundWindow is what you're looking for - but check the Platform
SDK documentation remarks section for the nitty gritty details!

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq



Mon, 12 Sep 2005 09:10:42 GMT  
 How to bring my dialog to top most?
I did try SetForgroundWindow(), but it only make the application's icon
blink on system bar, the application's dialog doesn't show up to top.
Quote:
> SetForgroundWindow is what you're looking for - but check the Platform
> SDK documentation remarks section for the nitty gritty details!

> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq



Mon, 12 Sep 2005 09:37:53 GMT  
 How to bring my dialog to top most?

Quote:
>I did try SetForgroundWindow(), but it only make the application's icon
>blink on system bar, the application's dialog doesn't show up to top.

That's why I said:

"check the Platform SDK documentation remarks section for the nitty
gritty details!"

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq



Mon, 12 Sep 2005 09:53:48 GMT  
 How to bring my dialog to top most?
Try setting the WS_EX_TOPMOST style. I use this and it works:

   ModifyStyleEx(0, WS_EX_TOPMOST);
   SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

Mike


Quote:
> I did try SetForgroundWindow(), but it only make the application's icon
> blink on system bar, the application's dialog doesn't show up to top.

> > SetForgroundWindow is what you're looking for - but check the Platform
> > SDK documentation remarks section for the nitty gritty details!

> > Dave
> > --
> > MVP VC++ FAQ: http://www.mvps.org/vcfaq



Mon, 12 Sep 2005 18:21:26 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Bring window to top in c$ with 2 processes running

2. Bring desktop window to the top of the Z-order

3. MFC SDI - how to activate without bringing window to top

4. How to bring an application to top-most?

5. Bring window to top

6. Bring item in TreeCtrl to top

7. Bringing an item to the top in CListCtrl

8. bringing a window to the top

9. How to bring a window to top

10. Bring single instance app to top

11. Bringing a CWnd to top

12. how to bring window on top

 

 
Powered by phpBB® Forum Software