aGorilla Posted April 13, 2008 Share Posted April 13, 2008 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? Search AutoItScript.com via Google Link to comment Share on other sites More sharing options...
Achilles Posted April 13, 2008 Share Posted April 13, 2008 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] Link to comment Share on other sites More sharing options...
Tomb Posted April 13, 2008 Share Posted April 13, 2008 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 More sharing options...
aGorilla Posted April 13, 2008 Author Share Posted April 13, 2008 (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 April 13, 2008 by aGorilla Search AutoItScript.com via Google Link to comment Share on other sites More sharing options...
aGorilla Posted April 13, 2008 Author Share Posted April 13, 2008 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. Search AutoItScript.com via Google Link to comment Share on other sites More sharing options...
Achilles Posted April 14, 2008 Share Posted April 14, 2008 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) WEndand 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 More sharing options...
aGorilla Posted April 14, 2008 Author Share Posted April 14, 2008 Thanks much. I was going to use it for a timed event, but then I stumbled across AdlibEnable. Search AutoItScript.com via Google Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now