Urgent also(Need help how to set the timer for outo logout when still run system)
hallo, Is me again. I'm beginner also is new member. I want to ask that how to do the function auto logout when the system still run (but the mouse don't move)? How to control this and the timer..
Thank for ur help
:)
first of all you need to have a little knowledge on API programming part.. there are some API can be used to capture the idle state of you keyboard or mouse action.. you need to intialize a timer control to capture the idle event.. set a preset time or delay to automatically logout after a predefined time.. good luck my fren.. :)
depending on your application, you could skip the whole api part. mouse movement on a form is fairly simple. But if you dont have a form or if you want to see how long the mouse has moved on the screen (and not on the form) then really, ignore everything from here down.
'<public declarations>
dim lastmoved as long
form_mousemove( Button As Integer, Shift As Integer, X As Single, Y As Single)
lastmoved = timer
end sub
timer1_timer() 'set interval to 1000 milleseconds.
if timer-lastmoved>120 then 'seconds, this is two minutes
call autologout
end if
end sub
ok, i may not have helped you with the auto log out, or much with the mouse move, but you have 2 lines of timer code!
(im looking into the auto logout bit.)
Thank for ur reply. very Happy because have people reply me. I know the API function but don't know how to apply in my system. can you send a simple code to me. If can't is ok,Anyway thank ur help and good suggestion. :)
Comment