Jump to content
Sign in to follow this  
kmps

How Can I Get The Timer Event When The Trayoneventmode Is Enabled

Recommended Posts

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!

Share this post


Link to post
Share on other sites

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!

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.

Share this post


Link to post
Share on other sites

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.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...