Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
Private Const SPI_GETSCREENSAVEACTIVE = 16&
Private Const SPI_SETSCREENSAVEACTIVE = 17&
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
'Active = True - To Activate
'Active = False - To Deactivate
'ScreenSaver False
'ScreenSaver True
Public Function ScreenSaver(Active As Boolean) As Boolean
Dim A As Long
Dim R As Long
A = Abs(Active) 'Needs 1 or 0
R = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, A, 0, 0)
ScreenSaver = (R > 0)
End Function
Public Function IsScreenSaverActivated() As Boolean
Dim A As Long
Dim R As Long
R = SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, A, 0)
IsScreenSaverActivated = (A <> 0)
End Function
Private Declare Sub mouse_event Lib "user32.dll" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Const MOUSEEVENTF_LEFTDOWN = &H2
Private Sub Form_Load()
Timer1.Interval = 50000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Call mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
End Sub
[COLOR=blue]Private Declare Sub mouse_event Lib "user32.dll" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Const [b]MOUSEEVENTF_MOVE = &H1[/b] [COLOR=green]' as detailed in one of my previous posts[/color]
Private Sub Form_Load()
Timer1.Interval = 50000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
[COLOR=green]' A tiny wiggle[/color]
Call mouse_event(MOUSEEVENTF_MOVE, 1, 0, 0, 0)
Call mouse_event(MOUSEEVENTF_MOVE, -1, 0, 0, 0)
End Sub[/color]