Solved

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

Posted on 1997-03-20
1
250 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 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