Dim UserID As String
Dim UserName As String
Dim GroupName As String
System.FixGetUserInfo UserID, UserName, GroupName
Dim WorkspaceApp As Object
Set WorkspaceApp = GetObject("","Workspace.Application")
Dim TargetVar As Object
Set TargetVar = WorkspaceApp.Documents("User").Page.FindObject("UserID")
TargetVar.CurrentValue = UserID
Set TargetVar = WorkspaceApp.Documents("User").Page.FindObject("UserName")
TargetVar.CurrentValue = UserName
Set TargetVar = WorkspaceApp.Documents("User").Page.FindObject("GroupName")
TargetVar.CurrentValue = GroupName
我的退出脚本如下:
Dim iResult
Dim hw&, cnt&
hw& = FindWindow("iFix Startup", vbNullString)
If hw& = 0 Then
MsgBox ("无法关闭演示系统。请使用 Windows任务管理器将工作台关闭。")
End If
If hw& <> 0 Then cnt& = SendMessage(hw&, &H10, 0, 0&)