ERFORDERLICHE
OBJEKTE
1 Timer (Timer1)
FORM-CODE
Private Declare Function SetWindowText Lib "user32" Alias _
"SetWindowTextA" (ByVal hWnd As Long, ByVal lpString _
As String)As Long
Private Declare Function GetWindowText Lib "user32" Alias _
"GetWindowTextA" (ByVal hWnd As Long, ByVal lpString _
As String, ByVal cch As Long) As Long
Private Declare Function GetForegroundWindow Lib _
"user32" () As Long
Private Sub Form_Load()
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Dim hWnd As Long
Dim s As String * 255
hWnd = GetForegroundWindow
GetWindowText hWnd, s, 255
pos = InStr(s, Chr$(0))
If pos > 0 Then s = Left$(s, pos - 1)
Zeichen = " " '-> Wichtig, ALT+255, kein Leerzeichen !
p = InStr(s, Zeichen)
If p > 0 Then s = Mid(s, 1, p - 1)
a = SetWindowText(hWnd, Trim(s) & Zeichen & _
Format(Now, "HH:MM:SS") & Zeichen)
End Sub
|