发表于:2004/8/26 9:28:00
#0楼
通过在VBA中调用NT/2000的API,可实现 在iFIX的画面中直接关闭iFIX,该方法可用于键宏或按钮。代码如下:(也可以参阅IFIX 2.5/2.6的Demo System)
Private Declare Function SendMessage& Lib "user32" Alias "SendMessageA" (ByVal _
hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As _
Any)
Private Declare Function Findwindow& Lib "user32" Alias "FindWindowA" (ByVal _
lpClassName As String, ByVal lpWindowName As String)
Private Sub cmdShutdowniFix_Click()
Dim lResult As Long
Dim iResult
Dim hw&, cnt&
hw& = Findwindow(vbNullString, "iFix Startup")
cnt& = SendMessage(hw&, &H10, 0, 0&)
End Sub