User Detection - The Next Generation
Posted: Wed Nov 17, 2021 1:17 am
Some older USB devices and device drivers worked without problems on anything before W10, and actually still work on Win10.
However, for some reason, when connecting such a device to a Win10 PC it appears to confuse the 'no user / user away' detection a bit.
If I connect my Jog Shuttle Pro, the program below keeps updating the 'last user activity' field. Is there an alternative way to detect if the user is gone?
(Why I need this: I change wallpapers preferably with the user NOT around, so any processing won't cause a 'hickup' during work.)
My old code is based on this:
Maybe I should add a CPU load detection, or something alse. Any suggestions for newer, smarter code welcome! 
However, for some reason, when connecting such a device to a Win10 PC it appears to confuse the 'no user / user away' detection a bit.
If I connect my Jog Shuttle Pro, the program below keeps updating the 'last user activity' field. Is there an alternative way to detect if the user is gone?
(Why I need this: I change wallpapers preferably with the user NOT around, so any processing won't cause a 'hickup' during work.)
My old code is based on this:
Code: Select all
x.LASTINPUTINFO
x\cbSize = SizeOf(x)
;
OpenWindow(1,10,10,150,50,"Test",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
StringGadget(1,10,20,130,20,"")
;
Repeat
WaitWindowEvent(1024)
GetLastInputInfo_(@x)
SetGadgetText(1,Str(x\dwTime))
Until Event() = #PB_Event_CloseWindow