谁知道如何通过按钮关闭iFIX 详细03
答案:1 悬赏:0 手机版
解决时间 2021-04-02 21:30
- 提问者网友:送舟行
- 2021-04-02 07:15
谁知道如何通过按钮关闭iFIX 详细03
最佳答案
- 五星知识达人网友:狂恋
- 2021-04-02 08:08
键宏或按钮。代码如下:(也可以参阅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 SubPrivate Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd
As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_SYSCOMMAND = &H112
Private Const SC_MAXIMIZE = &HF030& '最大化窗体
Private Const SC_CLOSE = &HF060& '关闭窗体
Private Const SC_MINIMIZE = &HF020& '最小化窗体
Private Const SC_RESTORE = &HF120& '恢复窗体大小
Private Sub Command1_Click()
'取得金山词霸窗体句柄
frmHwnd = FindWindow(vbNullString, "金山词霸 2003(暂停取词)")
If frmHwnd <> 0 Then
'发送最大化消息,使窗体最大化
SendMessage frmHwnd, WM_SYSCOMMAND, SC_MAXIMIZE, ByVal 0&End IfEnd SubFindWindow 是一个API 函数,不是VB 的函数!
iHwnd = FindWindow("要找的窗口类名","要找的窗口的标题")
返回值是该窗口的句柄。
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 SubPrivate Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd
As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_SYSCOMMAND = &H112
Private Const SC_MAXIMIZE = &HF030& '最大化窗体
Private Const SC_CLOSE = &HF060& '关闭窗体
Private Const SC_MINIMIZE = &HF020& '最小化窗体
Private Const SC_RESTORE = &HF120& '恢复窗体大小
Private Sub Command1_Click()
'取得金山词霸窗体句柄
frmHwnd = FindWindow(vbNullString, "金山词霸 2003(暂停取词)")
If frmHwnd <> 0 Then
'发送最大化消息,使窗体最大化
SendMessage frmHwnd, WM_SYSCOMMAND, SC_MAXIMIZE, ByVal 0&End IfEnd SubFindWindow 是一个API 函数,不是VB 的函数!
iHwnd = FindWindow("要找的窗口类名","要找的窗口的标题")
返回值是该窗口的句柄。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯