Sign in to follow this  
Followers 0
aGorilla

Trouble with my sytem tray menu.

7 posts in this topic

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?

Share this post


Link to post
Share on other sites



Try switching to TrayOnEventMode (and maybe GuiOnEventMode too)... You probably have some bug in your loop, so posting your code would probably help to so that we can see what's wrong.


My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Well, I did figure it would be a common 'noob' question.

Thanks Achilles, reading up on those now.

note to self: Don't read sigs while thanking somebody.

Edited by aGorilla

Share this post


Link to post
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.

Share this post


Link to post
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]

Share this post


Link to post
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
Sign in to follow this  
Followers 0