Solved

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

Posted on 1997-03-20
1
249 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

828 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