How to "Pop" a Windows App on Top of Other Windows Apps?

I have a windows application that when I start it, I want to let it run and let me go off and work on another windows application such as MS Word. When my application has completed its task, I would like for it to "pop" in front of the MS Word application (or whatever app is running) so that I know that my application has completed its task and is ready for new input.

How can I accomplish this

Would it be easier to have my entire application "pop" to the front or simply have some dialog box come to the front

Thanks for any help!



Answer this question

How to "Pop" a Windows App on Top of Other Windows Apps?

  • TopSQL

    Consider using the SetForegroundWindow() API call to do this. Yell if you need help with the declaration.



  • Eric Hsieh

    FlashWindow sounds good.

    Personally I hate it when a window thinks whatever it wants me to see is more important that what I'm doing right now, so pops itself to the front, interrupts my thoughts, and as my mouse snaps to a default button, I'll often click 'Yes' 'Delete' or summick on a dialog box I've not even read!

    Flash in the taskbar and I'll have a look when I've finished what I'm doing = much better behaved

  • Suggestion

    in my experience this isn't that easy, and SetForegroundWindow doesn't always put a window on top!

    Also try SetWindowPosition to set the window TopMost, then NotTopMost usually leaves it on top

  • stlb

    Both are about the same difficulty. To make a form come to the foreground: Me.TopMost = True. Which you do really depends on your design style and how intrusive you want the notice to be.
  • Stuart Ross

    You may also want to look at the FlashWindow API call. It'll flash the titlebar orange (or flash on the taskbar if it's minimized) - very similar to what MSN Messenger does with an incoming message.

    http://support.microsoft.com/ kbid=147815



  • Aluizio

    Thanks to everyone for their suggestions... I do think that I like the idea of "flashing" the task bar when my task is complete. I'll look into that one for sure....

    Thanks again!


  • How to "Pop" a Windows App on Top of Other Windows Apps?