kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
I have been doing some digging for a while now and I have come across cool stuffs concerning what I want to achieve.
The only setback is that they are scattered all over in bits.
So I came across this code from @Tom Urtis which tacks the movement of the mouse.
I want to display an alert when there is inactivity in the system for a given duration.
**I will use this to prompt user to login.
**If the alert is on already, I don’t want to pop it again(as that might cause some form of conflict)
Each time there is mouse movement, I want to reset the timer.
When I leave the active workbook to any other window, I want to show the alert (in this case an input box to accept user password) immediately.
I have also come across amazing workarounds from @Jaafar Tribak and the likes:
But I am finding it tougher to rightfully connect the dots.
I will be more than happy if someone can help me out for it.
Thanks in advance
Kelly Mort
The only setback is that they are scattered all over in bits.
So I came across this code from @Tom Urtis which tacks the movement of the mouse.
Code:
Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Public Type POINTAPI
x As Long
y As Long
End Type
Sub PositionXY()
Dim lngCurPos As POINTAPI
Do
GetCursorPos lngCurPos
Range("A1").Value = "X: " & lngCurPos.x & " Y: " & lngCurPos.y
DoEvents
Loop
End Sub
I want to display an alert when there is inactivity in the system for a given duration.
**I will use this to prompt user to login.
**If the alert is on already, I don’t want to pop it again(as that might cause some form of conflict)
Each time there is mouse movement, I want to reset the timer.
When I leave the active workbook to any other window, I want to show the alert (in this case an input box to accept user password) immediately.
I have also come across amazing workarounds from @Jaafar Tribak and the likes:
But I am finding it tougher to rightfully connect the dots.
I will be more than happy if someone can help me out for it.
Thanks in advance
Kelly Mort