PDA

View Full Version : Simulate mouse movements



Nec11
02-18-2013, 04:42 AM
Hello to all of you,

It is possible to simulate some mouse movements via an EXCEL VBA code let's say hourly to evoide screen saver appearance?

THANK YOU IN ADVANCE!!!

p45cal
02-18-2013, 08:45 AM
I think there might be, but maybe one of these will help?:
http://download.cnet.com/Stay-Awake/3000-2094_4-75623245.html
http://www.wilderssecurity.com/showthread.php?t=312763
http://www.softpedia.com/get/System/Launchers-Shutdown-Tools/Don-t-Sleep.shtml
http://www.pcworld.com/article/203917/Keep_Your_Computer_Awake_with_Mouse_Jiggler.html
http://stay-awake.murgee.com/
http://www.acapsoft.com/det.php?prog=Stims
http://download.cnet.com/Caffeine/3000-2094_4-10914397.html
http://www.zhornsoftware.co.uk/caffeine/index.html
http://alternativeto.net/software/caffeine-for-windows/
http://www.technipages.com/prevent-your-computer-or-session-from-sleeping.html

Paul_Hossler
02-18-2013, 05:29 PM
If you just and to turn off the SS while your program is busy, you can use the SystemParametersInfo API and turn it off (SS_Off) and then back on (SS_On) when your done


Option Explicit
'ref: http://support.microsoft.com/kb/97142
'The uAction argument can be one of the following constants
Const SPI_GETBEEP = 1
Const SPI_SETBEEP = 2
Const SPI_GETMOUSE = 3
Const SPI_SETMOUSE = 4
Const SPI_GETBORDER = 5
Const SPI_SETBORDER = 6
Const SPI_GETKEYBOARDSPEED = 10
Const SPI_SETKEYBOARDSPEED = 11
Const SPI_LANGDRIVER = 12
Const SPI_ICONHORIZONTALSPACING = 13
Const SPI_GETSCREENSAVETIMEOUT = 14
Const SPI_SETSCREENSAVETIMEOUT = 15
Const SPI_GETSCREENSAVEACTIVE = 16
Const SPI_SETSCREENSAVEACTIVE = 17
Const SPI_GETGRIDGRANULARITY = 18
Const SPI_SETGRIDGRANULARITY = 19
Const SPI_SETDESKWALLPAPER = 20
Const SPI_SETDESKPATTERN = 21
Const SPI_GETKEYBOARDDELAY = 22
Const SPI_SETKEYBOARDDELAY = 23
Const SPI_ICONVERTICALSPACING = 24
Const SPI_GETICONTITLEWRAP = 25
Const SPI_SETICONTITLEWRAP = 26
Const SPI_GETMENUDROPALIGNMENT = 27
Const SPI_SETMENUDROPALIGNMENT = 28
Const SPI_SETDOUBLECLKWIDTH = 29
Const SPI_SETDOUBLECLKHEIGHT = 30
Const SPI_GETICONTITLELOGFONT = 31
Const SPI_SETDOUBLECLICKTIME = 32
Const SPI_SETMOUSEBUTTONSWAP = 33
Const SPI_SETICONTITLELOGFONT = 34
Const SPI_GETFASTTASKSWITCH = 35
Const SPI_SETFASTTASKSWITCH = 36

'The fuWinIni argument updates the WIN.INI file:
Const SPIF_SENDWININICHANGE = &H2
Const SPIF_UPDATEINIFILE = &H1

'Here are the formal arguments to the function:
' uAction system parameter to query or set
' uParam depends on system parameter
' lpvParam depends on system parameter
' fuWinIni WIN.INI update flag
Declare Function SystemParametersInfo Lib "user32" _
Alias "SystemParametersInfoA" ( _
ByVal uAction As Long, _
ByVal uParam As Long, _
ByVal lpvParam As Any, _
ByVal fuWinIni As Long) As Long


Sub SS_Off()

Call SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 0&, 0&, 0&)
End Sub

Sub SS_On()
Call SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 1&, 0&, 0&)
End Sub

Sub SS_Toggle()
Dim b As Long
Call SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, b, 0&, 0&)

b = IIf(b, 0, 1)

Call SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, b, 0&, 0&)
End Sub




Paul

Nec11
02-21-2013, 11:36 PM
Tried, but unsuccessful !

The Screen Saver and Power Saver still does their job.

Any other ideas?

THX

Paul_Hossler
02-22-2013, 07:39 PM
Sorry about that -- seems to work on my home PC

A work there's GPOs that prevent us mere users from changing settings like that. You're PC isn't 'locked down' like that?

What version of Windows and Office are you using?

Paul