🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #568

Re: Preventing the screen saver from activating

#568
From: Remy Lebeau (TeamB)
Date: Wed, 27 Feb 2008 17:59
23 lines
2037 bytes
"Kris" <x@x.com> wrote in message news:47c523d4@newsgroups.borland.com...

> 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.

I wrote my own utility to prevent the screen saver from running, but I took 
a different approach with it.  Instead of simulating activity periodically, 
I actually intercept the notification that the OS sends out just prior to 
starting the screen saver.  The problem is that the notification is only 
sent to the foreground application, so I use a global hook to look for that 
notification in all running processes.

> Anyway, I assumed that simulating mouse activity would prevent
> the screensaver from popping up. But it doesn't...

Try using mouse_event() instead.  That is a lower-level function that the 
mouse driver itself calls.  SetCursorPos() may be too higher level to effect 
the screen saver tracking logic.


Gambit 
Technical Details
Message-ID: <47c5a4e6$1@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-mail
References: <47c523d4@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,abe368cd9dc323e7
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <47c523d4@newsgroups.borland.com>
Subject: Re: Preventing the screen saver from activating
Date: Wed, 27 Feb 2008 09:59:29 -0800
Lines: 25
Organization: Lebeau Software
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 207.178.157.90
Message-ID: <47c5a4e6$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1204135142 207.178.157.90 (27 Feb 2008 09:59:02 -0700)
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