473,387 Members | 1,476 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Stopping screen saver

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?

thank you
Jan 25 '07 #1
2 4881
Hi Claire,
You could try using p/invoke to call SystemParametersInfo:

[DllImport("user32.dll", SetLastError = true)]
static extern bool SystemParametersInfo(uint uiAction, uint uiParam,
IntPtr pvParam, uint fWinIni);
public const int SPI_SETSCREENSAVEACTIVE = 0x0011;

Then call it like this:
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 0, IntPtr.Zero, 0);

Hope that helps,
John

Claire wrote:
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?

thank you
Jan 25 '07 #2
I found something. Sorry for bothering you

http://www.codeproject.com/csharp/Sc...verControl.asp
Jan 25 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
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
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. --
2
by: HumptyDumpty | last post by:
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...
1
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
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...
1
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
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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
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...

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.