ECS-L Home Automation and Security Archives
  learn more | view messages for this month | NetBloc® | terms of use | search

Google
 


  subject (prev) or (next) | time (prev) or (next) | author (prev) or (next) | view more subjects

Subject:
From:
Date:
RE: [ECS] killing the screen saver
Dan Hoehnen
Sat, 8 Jan 2000 09:31:14 -0500

Scott,

Here is some code I use in ACE (written in VB6) in order to move the mouse
and click mouse buttons.  In most cases, they de-activate the screen saver.
These are all Windows API functions so you can call them from C too.

Move the mouse to center of screen:
Call mouse_event(MOUSEEVENTF_MOVE Or MOUSEEVENTF_ABSOLUTE, 32000, 32000, 0,
0)

Move mouse to specific screen location:
Call mouse_event(MOUSEEVENTF_MOVE Or MOUSEEVENTF_ABSOLUTE, wParam, lParam,
0, 0)

Left button click:
Call mouse_event(MOUSEEVENTF_MOVE Or MOUSEEVENTF_ABSOLUTE Or
MOUSEEVENTF_LEFTDOWN, wParam, lParam, 0, 0)
Call mouse_event(MOUSEEVENTF_MOVE Or MOUSEEVENTF_ABSOLUTE Or
MOUSEEVENTF_LEFTUP, wParam, lParam, 0, 0)

Middle and right buttons clicks are done the same way, just use MIDDLExxx
and RIGHTxxx.

Declaration for mouse_event subroutine:
Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dX
As Long, ByVal dY As Long, ByVal cButtons As Long, ByVal dwExtraInfo As
Long)

Have fun!

Dan Hoehnen
dhoehnen@infinet.com
He who dies with the most toys, wins!
*************************************************************************
* Home Automation Index: http://www.infinet.com/~dhoehnen/ha/list.html  *
*                                                                       *
* ACE Home Automation Software - Supports HomeVision, ECS, Omni/Aegis,  *
*   StarGate and most other automation systems - Caller ID, TTS,        *
*   Internet and intranet support, Touchscreen support, E-Mail, much    *
*   more...                                                             *
*                                                                       *
* Port16.ocx & Port32.ocx - Give Visual Basic access to I/O ports       *
*                                                                       *
*                http://www.infinet.com/~dhoehnen/software/             *
*************************************************************************

> -----Original Message-----
> From: Scott Reston [mailto:ih8gates@concentric.net]
> Sent: Saturday, January 08, 2000 9:18 AM
> To: ecs-list@netbloc.com
> Subject: Re: [ECS] killing the screen saver
>
>
> thanks, ingo - i'll take a look at that C sample to see if i can
> write something to deactivate the screen saver. my HA machine is
> running Win98, but setting a key-
> event doesn't appear to work on my machine...
>
> thanks!
>
>
>
> scott reston
> ih8gates@concentric.net
> http://www.indelible-blue.com/meetib/scott/
>
>
> On Fri, 07 Jan 2000 21:42:07 -0800, Ingo Pakleppa wrote:
>
> >I'm not sure if that applies here, but according to the
> Microsoft Knowledge
> >Base, this should only work on 95/98. On NT, the screen saver would reset
> >it's timer only in response to mouse events and not to keyboard events
> >(interestingly, on 95, it responds only to keyboard but not to mouse
> >events). Under NT, neither keyboard nor mouse events kill the
> screen saver.
>
>
>
>


  subject (prev) or (next) | time (prev) or (next) | author (prev) or (next) | view more subjects




Services provided by [NetBloc]®! NetBloc Solutions Inc.
Terms of use. Indexing software (c) 1999 Lin-De, Inc
.