|
-
Oct 14th, 2000, 12:01 AM
#1
Thread Starter
Lively Member
First of all, anyone know how to get the username of the currently logged on user?
Second of all, how can i tell how long the pc has been idle, no mouse movement and no keyboard movement?
Thirdly, regarding access databases being used through vb, if i have several the same on several servers, how do i go about syncing them at the end of the days work?
Thanks
Daniel Rose
VB 5.0 Enterprise.
irc:irc2.dynam.ac
If TheCodeInTheSig() Is Not Lame() Then IDontKnowWhatIs()
-
Oct 14th, 2000, 06:18 AM
#2
transcendental analytic
1. I've answered that user logged qwestions
http://forums.vb-world.net/showthrea...threadid=35327
2.
Put this code in a module
Code:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetTickCount Lib "kernel32" () As Long
Type POINTAPI
x As Long
y As Long
End Type
Function IddleTime() As Long
Static start As Long, mousepos As POINTAPI, testpos As POINTAPI
For x = 0 To 255
If (GetAsyncKeyState(x) <> 0) Then start = GetTickCount
Next x
GetCursorPos testpos
If testpos.x <> mousepos.x Or testpos.y <> testpos.y Then mousepos = testpos: start = GetTickCount
IddleTime = GetTickCount - start
End Function
And call iddletime function very frequently, for instance in a timer:
Code:
Private Sub Timer1_Timer()
Caption = IddleTime
End Sub
Set it's interval to 60
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|