Article View: borland.public.cppbuilder.nativeapi
Article #703Preventing the screen saver from activating
From: Kris
Date: Wed, 27 Feb 2008 08:46
Date: Wed, 27 Feb 2008 08:46
38 lines
2258 bytes
2258 bytes
Hi, I am searching for a solution concerning following situation: - A Windows installation where the user has limited rights - The screensaver pops up after x minutes and asks for a password - The user is not allowed to change the screensaver parameters The screensaver time-out is set very low and it is very annoying that you have to re-enter your password after a brief period of inactivity. So, I wrote a small utility that periodically moves the mouse cursor a bit and thus - I assumed - would reset the Windows inactivity timer. Hence no screensaver should ever pop-up. OnTimer: POINT Position; GetCursorPos(&Position); SetCursorPos(Position.x+1,Position.y+1); SetCursorPos(Position.x,Position.y); This code is activated by a timer (at first I used rather large intervals, but intervals which are smaller than the screen saver activation time, but now I've even tried an interval of 25ms). I've used several variations on the above theme (e.g. every odd minute, cursor +1, every even minute cursor -1) Anyway, I assumed that simulating mouse activity would prevent the screensaver from popping up. But it doesn't... Does anyone have some ideas ? Perhaps I'm looking at this completely wrong and there's a simple API (and which is accessible when having limited rights) that allows you to accomplish this ? Thanks, Kris
Technical Details
Message-ID:
<47c523d4@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,abe368cd9dc323e7,start X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Wed, 27 Feb 2008 09:46:39 +0100 From: Kris <x@x.com> User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Preventing the screen saver from activating Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 81.242.6.168 Message-ID: <47c523d4@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1204102100 81.242.6.168 (27 Feb 2008 00:48:20 -0700) Lines: 42 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail