参照ifix自带的例子程序做的。
定义一个退出按钮,添加脚本
Private Sub EXIT0_Click()
Dim sUserID As String
Dim sUserName As String
Dim sGroupName As String
On Error Resume Next
System.FixGetUserInfo sUserID, sUserName, sGroupName
If sUserName = "GUEST" Then
Dim lResult As Long
Dim iResult
Dim hw&, cnt&
hw& = FindWindow(vbNullString, "iFix Startup")
If hw& = 0 Then hw& = FindWindow(vbNullString, "iFix Startup - 演示方式")
If hw& <> 0 Then cnt& = SendMessage(hw&, &H10, 0, 0&)
' Form3.Show
Else
MsgBox "对不起,您没有身份,无权访问!", vbOKOnly + vbCritical, "错误信息"
End If
End Sub