473,507 Members | 9,962 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Screen Saver Enabling/Disabling

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
2 2825
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
12214
by: Michael J Whitmore | last post by:
Greetings, I have a very simple question. How do you simulate a user input to turn off a screen saver in Windows (either a mouse movement, mouse click, or keyboard input)? I promise I searched...
2
2501
by: Card.Starzinger | last post by:
Hi! I need help to simulate programmatically user interaction on WinNT 4.0, to avoid screen saver activation. I try with key injection event. SendInput API and keybd_event API work...
3
2331
by: Thom Little | last post by:
How do I invoke the current screen saver with C#? Where did you find the information on how to do it? -- -- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd. --
1
2249
by: Daniel | last post by:
Hi all, i have a doubt related to the screen saver ability. After developing the asp.net webform, can i add screen saver ability in this webform? which means, i open the asp.net webform, after a...
0
3253
by: Jeffery Tyree | last post by:
I have a machine that will be used to demo some Excel spreadsheets at a convention. Because I did not author the spreadsheets and attendees will be allowed to play with the spreadsheets, I needed...
2
4900
by: Claire | last post by:
Hi, Our software runs on a XP system attached to a touch screen monitor and smartcard USB reader. We run our own simple corporate screen saver. When the screen is touched the screen saver...
1
2365
by: ashwiniappajigowda | last post by:
Hi, I have an simple MFC dialog based application. On launch of that application 'Password protected screen saver' is not getting activated after the screen saver timeout. If 'On resume,...
3
5747
by: KK | last post by:
Dear All I want to prevent the screen saver getting activated when my application is running. I have the following code, but still screen saver is activated. What corrections I should make to...
0
1250
by: rehanrana | last post by:
I built application in VB6, my application appear in system tray, when I double click on icon of my application, it run screen saver, my screen saver shows images and news. Screen saver...
0
7221
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7109
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5039
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3190
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1537
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.