用消息方式如何实现点易做图中的按钮
用消息方式如何实现点易做图中的按钮能不能用vb实现, --------------------编程问答--------------------
public Sub ClickToolBarButton(oToolBar As MSComctlLib.Toolbar,lButtonIndex as long)
Dim hToolBarLib As Long
Dim lButtonID As Long
If Not oToolBar Is Nothing Then
hToolBarLib = FindWindowEx(oToolBar.hWnd, 0, "msvb_lib_易做图", vbNullString)
lButtonID=IDFromIndex(hToolBarLib,lButtonIndex)
call sendMessage(hToolBarLib,WM_COMMAND,0,byval lButtonID)
End If
end sub
'/* 根据按钮的索引获取按钮的内部ID值
Public Function IDFromIndex(ByVal hToolBar As Long, ByVal lButtonIndex As Long) As Long
Dim lRetCode As Long
Dim tButton As TBBUTTON
lRetCode = SendMessage(hToolBar, TB_GETBUTTON, lButtonIndex, tButton)
If CBool(lRetCode) Then
IDFromIndex = tButton.idCommand
Else
IDFromIndex = -1
End If
End Function
只是凭印象写的,看一下是否可以使用。
补充:VB , API