Sign in to follow this  
Followers 0
JonathanKing

Tray icon not updating unless mouse hovers over top

7 posts in this topic

#1 ·  Posted (edited)

Hi,

I am writing a script to allow an end-user (teachers) to delay the onset of screensaver activation. Things are looking pretty good, and I have some more tweaks to perform, but the main issue I have is that the tray icon only updates if I hover the mouse over it. I imagine this is rather trivial, but I cannot sort it out. Can anyone help? I am targetting this only to Windows 7 x32 if that helps. Also, my mousemove code doesn't seem to actually prevent screensaver activation!

Thanks in advance,

-jonathan

p.s. I first wrote this using the OnEvent model, but had trouble pausing functions that were running when selecting an option from the tray menu. I imagine this is related to being rather new to AutoIT, but if anyone has insight on how to rewrite this the 'modern' event-driven way, I'd be quite receptive!

Screensaver Delay.au3

Edited by JonathanKing

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Take out the

Case $msg = 0

ContinueLoop

from your script. That will fix the problem. Putting ContinueLoop in there starts the loop over from the beginning so it never gets to the rest of your code.

Your script will eat up a lot of processor power so you should put some pauses in there somewhere.

Edited by Gestalt

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Erm: Never mind my (previous, wrong and removed) ContinueCase note.

just remove the ContinueLoop. But you can leave the Case $msg = 0 to skip the additional case checks.

Your script will eat up a lot of processor power so you should put some pauses in there somewhere.

Incorrect. TrayGetMsg(), just like GUIGetMsg(), has a build in sleep functionality to prevent unnecessary cpu use. (see help documentation)(when used in none TrayOnEvent mode.)

I am writing a script to allow an end-user (teachers) to delay the onset of screensaver activation.

This make no sens to me. As in 'just moving the mouse(user)' should do the same. Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

Thank you both for pointing out my incorrect use of ContinueLoop. I used the sample code from the documentation without fully understanding that component. Bad Programmer!

While it is true that just moving the mouse resets the idle time, we have teachers who may choose to display something on-screen/projector for an entire 75 minutes course, but don't want to have to fiddle with the computer during that time to stop the screensaver. So, this app is being written to allow the user to choose an amount of time to stop the screensaver from activating. I hope that makes sense!

Thanks again for the assistance,

-jonathan

Share this post


Link to post
Share on other sites

we have teachers who may choose to display something on-screen/projector for an entire 75 minutes course,

Seems more easer and appropriate to directly manipulate the screensaver settings in the windows registry. But I would not suggest trying that until you know the basic of the windows registry and than how to use the autoit registry functions.

And you don't really need autoit for this.Using registry shortcuts to disable and enable screen savers in Windows XP


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

MvGulik,

I am aware of the systems you mention, but I set everyone's screensaver timeout to 15 minutes via group policy. As a result, there is nothing a user can do to change the setting; even manipulating the registry key is ignored when GP is in effect. Of course, if I'm wrong about that, I'd love to know. We are using Windows 7.

Thanks for the advice and help,

-jonathan

Share this post


Link to post
Share on other sites

Clear.

I only know of group policy's from a little Wk2srv contact some time ago. So can't help in that area.

(someone else perhaps?)


"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

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