By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,837 Members | 1,842 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,837 IT Pros & Developers. It's quick & easy.

Screen Saver Enabling/Disabling

P: n/a
Does anyone know if there is a problem with re-enabling the Screen
Saver after it has been disabled programmatically.

I am using the SystemParametersInfo function within User32.dll, and
have been successful in disabling the Screen Saver, but it does not
work for re-enabling. The only way I can re-activate it is to
re-apply the settings through the Display properties in the Control
Panel.

Sample lines of code, in simplest form:

// Screen Saver disable
SystemParametersInfo( 17, 0, 0, 0);

// Screen Saver enable
SystemParametersInfo( 17, 1, 0, 0);

I have discovered there may be problems with retrieving the Active
status, but have not found any information relating to
re-activation.

Your assistance would be much appreciated.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
This is al very vague but maybe it can put you in the rught direction...

I believe I have read somewhere that when the screensaver kicks in, windows
will send a message to all running applications, so maybe you can override
the WndProc method on NativeWindow or a Form to capture that message and
work from there.

Greets..

G.

"HumptyDumpty" <Hu***************@ic24-dot-Net.no-spam.invalid> schreef in
bericht news:42**********@127.0.0.1...
Does anyone know if there is a problem with re-enabling the Screen
Saver after it has been disabled programmatically.

I am using the SystemParametersInfo function within User32.dll, and
have been successful in disabling the Screen Saver, but it does not
work for re-enabling. The only way I can re-activate it is to
re-apply the settings through the Display properties in the Control
Panel.

Sample lines of code, in simplest form:

// Screen Saver disable
SystemParametersInfo( 17, 0, 0, 0);

// Screen Saver enable
SystemParametersInfo( 17, 1, 0, 0);

I have discovered there may be problems with retrieving the Active
status, but have not found any information relating to
re-activation.

Your assistance would be much appreciated.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 17 '05 #2

P: n/a
Thanks Guy.

I have solved the problem with WndProc as you mentioned. The downside
is its quite an inefficient way to solve the problem.

I have since resolved the problem using the User32.dll. There does
seem to be a bug in that you cannot detect the current activeness of
the screen saver, but an alternative workaround is to use check a
registry key instead.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.