473,769 Members | 7,097 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 programmaticall y.

I am using the SystemParameter sInfo 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
SystemParameter sInfo( 17, 0, 0, 0);

// Screen Saver enable
SystemParameter sInfo( 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 2841
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.

"HumptyDump ty" <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 programmaticall y.

I am using the SystemParameter sInfo 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
SystemParameter sInfo( 17, 0, 0, 0);

// Screen Saver enable
SystemParameter sInfo( 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
12239
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 the newsgroup before asking :) I have written the following program that loads all my Webshots files into the Webshots photo manager, or so I thought. When you load the first it starts the screen saver. All other subsequent ones are not
2
2516
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 correctly with Win2000 and WinXP system. Screen saver don't start.
3
2365
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
2270
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 few minutes the web form will act as a screen saver. In the screen, it only show summary of each product in real time(which mean the webform is still performing in background and the screen saver will be real time update the summary). Will it...
0
3282
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 a way to periodically restore the original versions. In addition to the "always-on-top click this button to reset demo" application I wrote, I chose to use screen saver code to reset the demo after a period of inactivity in the event an attendee...
2
4919
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 vanishes, but when a user inserts a smartcard (we're polling for inserts) the screen saver doesn't vanish. Is there any way we can awaken the system and stop the screen saver from code please?
1
2378
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, password protect' option unchecked, I am getting the Screen saver. Application not generating any of the keyboard or any user events to
3
5763
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 prevent screen saver running to the following code. public class MainForm : System.Windows.Forms.Form { private static readonly int SC_SCREENSAVE = 0xF140;
0
1263
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 functionality is that when user press F2 key, my screen saver open news detail in browser. But the problem is that when screen saver stop (close), browser also close with the screen saver. following line i use to start screen saver lRet =...
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10048
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9865
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7410
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.