Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
4.05/5 (7 votes)
I need to know when the screen saver has ended. Windows sends the WM_SYSCOMMAND message with the SC_SCREENSAVE parameter when the screen saver starts, but I have not been able to figure out how to tell when the screen saver ends. Google is no use as all I get there is free screen saver apps.

Does anyone have any idea? I could monitor the mouse and keyboard but there has got to be a better way.
Posted
Updated 16-Apr-13 19:39pm
v2
Comments
Manfred Rudolf Bihy 17-Apr-13 1:29am    
What language are you using?
My google results were fine. "Screensaver activate deactive" "check screensaver running".
Your google foo seems to be lacking today. :P

Cheers!
Sergey Alexandrovich Kryukov 17-Apr-13 1:34am    
A 5! :-)
—SA
Manfred Rudolf Bihy 17-Apr-13 1:35am    
Thanks, SA!
PJ Arends 17-Apr-13 1:38am    
Yes it is lacking. Using "check screensaver running" I was able to find that I just need to use the SystemParametersInfo function and specify the SPI_GETSCREENSAVERRUNNING parameter.

Thanks for the tip.

Now it is time to go to bed and recharge the brain.
Manfred Rudolf Bihy 17-Apr-13 2:16am    
I just saw that you're from Canada. So it must be way past bed time for you. ;)
Here in Germany it's 8:15 AM, so the day has just started for me.
Cheers!

1 solution

There is a way of checking if the screensaver is still running. See the discussion on MSDN: Screen Saver notifications[^]. nobugz[^] answer shows how to pinvoke SystemParametersInfo to poll the current status of the screensaver.

Google search: "C# screen saver running"

Regards,

— Manfred
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 17-Apr-13 1:39am    
As I say, a 5. :-)
—SA
Pete O'Hanlon 17-Apr-13 2:51am    
Do you not think that this is completely unnecessary? While it's great that you voted someone a 5, you don't need to tell them afterwards. They already know they've been voted a 5. Telling them that you voted them a 5 is not needed unless you think they feel they need your seal of approval. Granted, we've all been guilty of saying this at one time or another, as you are such a prolific poster here, is it not time for you to take the lead?
Sergey Alexandrovich Kryukov 17-Apr-13 12:09pm    
Pete,

Yes, I did think about it. I don't know why did you start to fight this at that time, even if you are right. Good or not, but presently such comments is an established style of communications, as well as saying "thank you" to the voter. Well, let's discuss it.

Do you suspect this is done in expectation of reciprocal support, or something like that, like a revenge for down-votes (which actually happens)? Just put is straight. Yes, it may take place, but I noticed that members do not hesitate do down-vote even immediately after a good vote from a fellow expert. This is honest decent approach prevalent in good experts, in my observation.

Decent members actually vote for value, not in reciprocal appreciation, and down-vote for a reason, not revenge. I think you have to admit it.

(At the same time, there is a good number of "experts" who are even simply cheating to get votes. This is, by the way, is a really serious problem. When I report such cases, the effect is very limited. How about addressing this problem instead? The harm is not the votes and scores: it creates unacceptable moral climate and and discourages honest beginner experts.)

I'm ready to think at your idea, but not ready to follow it.

I can tell you my idea why I actually want voters to tell their names: I want to receive feedback to my solutions. Let me tell you: I receive considerable number of 1s from anonymous (naturally), and, quite rarely, from some people who looks morons to me (by other reasons, of course). And then I consider it normal: a moron is just obliged to down-vote a good solution, it partly confirms that a solution is good. And when a member I respect votes 1 for me (it happens), I'm get disturbed and often (not 100%) see this person was right. In this case, I fix myself (everyone can see that I fix myself and express gratitude for the criticism). That's why I really like to see who is voting.

Can you see my point?

Thank you,
—SA
wizardzz 17-Apr-13 12:13pm    
Do you comment every time you downvote, too?
Sergey Alexandrovich Kryukov 17-Apr-13 12:20pm    
Good question. Quite frankly, I do not comment every time I down-vote and not every time I up-vote. Do you think it's bad? I think that there are posts not deserving a comment. Do you disagree? I still consider my arguments above reasonable.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900