kmps Posted April 23, 2006 Posted April 23, 2006 Hello, I am now writing a script running backgroud as a windows service,and now I disables the TrayOnEventMode and just uses the function traygetmsg() to deal with the things every 5 mins but I found in this model my script's CPU's utilization will get too much sometimes,any good man can tell me if I switch to enable the TrayOnEventMode will solve the problem?and How to define the timer event function in this mode? thanks a lot!
AutoChris Posted April 24, 2006 Posted April 24, 2006 Hello, I am now writing a script running backgroud as a windows service,and now I disables the TrayOnEventMode and just uses the function traygetmsg() to deal with the things every 5 mins butI found in this model my script's CPU's utilization will get too much sometimes,any good man can tellme if I switch to enable the TrayOnEventMode will solve the problem?and How to define the timer eventfunction in this mode?thanks a lot!Please post some code. The most likely answer would be to throw a Sleep(300000) ; five minutes into your loop, assuming you have a loop in your code. If not, I am curious how you expect to receive any commands from the tray icon if you only check every 5 minutes.
kmps Posted April 25, 2006 Author Posted April 25, 2006 hello,thank you very much.the Sleep solved my problem.Please post some code. The most likely answer would be to throw a Sleep(300000) ; five minutes into your loop, assuming you have a loop in your code. If not, I am curious how you expect to receive any commands from the tray icon if you only check every 5 minutes.
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