NotifyIcon and SetForegroundWindow

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    NotifyIcon and SetForegroundWindow

    I use NotifyIcon to minimize my app to the system tray. I also check
    everytime my app runs for the previous instance, if it is running, call
    SetForegroundWi ndow to bring its window up front and exit the second
    instance.

    The problem is it doesn't bring the app out of the system tray. It works
    fine if the app is NOT in the system tray. How do I bring it out of the
    system tray and make it an active window? Thanks


  • DalePres

    #2
    Re: NotifyIcon and SetForegroundWi ndow

    John,

    I misread this the last time you asked it. I understand now what you're
    trying to do.

    What you have to do is, rather than the new instance trying to restore the
    existing instance, the new instance should send a WM_SETTEXT Windows message
    from the new instance to the original instance using the SendMessage API
    function. This way you can send a specifically coded text message to the
    original application. The original application can be programmed to
    recognize this code and, in response, restore itself properly.

    Hope this helps.

    Dale


    "John" <so@hotmail.com > wrote in message
    news:%23Q3P3Os6 DHA.2568@TK2MSF TNGP10.phx.gbl. ..[color=blue]
    > I use NotifyIcon to minimize my app to the system tray. I also check
    > everytime my app runs for the previous instance, if it is running, call
    > SetForegroundWi ndow to bring its window up front and exit the second
    > instance.
    >
    > The problem is it doesn't bring the app out of the system tray. It works
    > fine if the app is NOT in the system tray. How do I bring it out of the
    > system tray and make it an active window? Thanks
    >
    >[/color]


    Comment

    Working...