Jump to content

Trouble with my sytem tray menu.


Recommended Posts

Ok, so I have this cool little system tray app. There's a couple of cases where it opens up a Gui window - one for user settings, another for a limited web browser.

The problem is, when I launch one of the windows, clicking on the system tray menu adds a request to a queue, but doesn't do anything until the window is closed. Once it's closed, it rips through the queue, which can be amusing, but is mostly just annoying.

Any suggestions?

Link to comment
Share on other sites

Ok, so I have this cool little system tray app. There's a couple of cases where it opens up a Gui window - one for user settings, another for a limited web browser.

The problem is, when I launch one of the windows, clicking on the system tray menu adds a request to a queue, but doesn't do anything until the window is closed. Once it's closed, it rips through the queue, which can be amusing, but is mostly just annoying.

Any suggestions?

this is very easy to answer without seeing any code.

note that italicized text in this case represents sarcasm.

Link to comment
Share on other sites

Thanks again Achilles. That solved everything - had to switch the tray and the Gui to 'OnEventMode'. That led to a new problem, now I was getting multiple occurances of the windows. Fixed that with a test for WinGetHandle and used WinActivate if it was found.

During the change, I had to add in 'idle loop' at the end of the menu tray (or else it just vanished):

While 1
    Sleep(10)  ; Idle loop
  WEnd

I'm assuming this is normal, but I'm not sure what the impact of changing the '10' would be. I'm guessing that if I make it larger, the tray menu will be less responsive? Just curious.

Link to comment
Share on other sites

Changing that time won't affect anything. As soon as you perform an event (like clicking a tray item or gui control) it goes automatically to the function. Generally, your loop is there just to keep the program running. You can use it for other stuff but you don't need it for the tray or gui. So, you could have:

While 1 
Sleep(20000)
WEnd
and your code would work exactly the same.
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...