So, hab ich's doch noch geschafft, das Script Äquivalent zu @Command([ToolsUserLogoff]) zu programmieren
'*// Dies kommt in die Declaration Sektion
Const VK_F5 = &H74
Const KEYEVENTF_KEYDOWN = &H0000
Const KEYEVENTF_KEYUP = &H0002
Declare Sub WIN32_KeyBoardEvent Lib "User32" Alias "keybd_event" ( Byval bVirtualKey As Integer , Byval bScanCode As Integer , dwFlags As Long , dwExtraInfo As Long )
'*// hier die eigentliche Routine
Sub Logoff ( )
Dim ModuleName As String
ModuleName = {Logoff}
On Error Goto ErrorHandler
WIN32_KeyBoardEvent VK_F5 , 0 , KEYEVENTF_KEYDOWN , 0
WIN32_KeyBoardEvent VK_F5 , 0 , KEYEVENTF_KEYUP , 0
Exit Sub
ErrorHandler:
Select Case fnErrorHandler ( Error$ , Err , Erl , ModuleName )
Case 0
Exit Sub
Case 1
Resume Next
Case Else
Resume Next
End Select
End Sub
'*// und noch ein bisschen Fehlerbehandlung
Function fnErrorHandler ( strErrorText As String , lngErrorNumber As Long , lngErrorLine As Long , strModuleName As String ) As Integer
Print ( {ERROR: } + strErrorText + { (Nr.: } + Cstr ( lngErrorNumber ) + {, Line: } + Cstr ( lngErrorLine ) + {, Module: } + strModuleName + {)} )
fnErrorHandler = 1
End Function
Und so wird das ganze dann aufgerufen :
Sub Click(Source As Button)
Call Logoff
End Sub