Solved

How to reset the system timeout screen saver progammatically (NT)?

Posted on 1997-03-20
1
245 Views
Last Modified: 2013-12-03
Hi all,
  Windows NT: Could anyone tell me how I can reset programmatically the system time-out that
controls the screen saver?
  I've written a application to communicate Windows and a serial keyboard.
I'm using the Win API Keybd_event(VK_Mykey,0,0,0) function to synthesize a keystroke, but although the
"keys" are sent to the applications, the system "ignores" these "keys" in order to activate
or deactivate the screen saver. I know how I can kill the screen saver, but so far I have not
been able to stop the screen saver timeout whenever I send one of my "keys" to Windows.
I would really appreciate any help. Many thanks in advance.
   
   Javier Campos
0
Comment
Question by:churri
1 Comment
 
LVL 1

Accepted Solution

by:
mbecker011597 earned 100 total points
ID: 1298687
To keep the screensaver from activating while your
application has focus do the following:

In your message loop, look for the WM_SYSCOMMAND
message with wParam==SC_SCREENSAVE and silently
ignore it (i.e. return). The screensaver only gets
activated if you pass this message to DefWndProc()

M.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now