@Command([ToolsUserLogoff]) in Lotus Script

October 9, 2004 – 9:31 am

Mit Hilfe der Windows API kann der Befehl @Command([ToolsUserLogoff]) in Lotus Script simuliert werden.

1
2
3
4
5
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 )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
 
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 zum Testen folgender Aufruf

1
2
3
Sub Click(Source As Button)
  Call Logoff
End Sub

Related posts:

  1. Calculate Elapsed Time Between Two Date/Time Values
  2. Play MP3 without WINAMP using Lotus Script
  3. Check Formula Syntax
  4. Enumerating Local And Network Drives
  5. Determine Drive Types and Next Available Drive Letter

  1. One Response to “@Command([ToolsUserLogoff]) in Lotus Script”

  2. Do you have an updated code for Ver 8.0. This code will not work for ver 8.0 as it uses CTRL+F5,

    By Sam on Feb 18, 2009

Sorry, comments for this entry are closed at this time.