请教大家一个调用问题
我想在程序中调用一个exe执行文件,并且执行exe程序里面的一个按钮事件
请问 有什么方法或是函数?
[解决办法]
顶~~~~~~~~~~~
[解决办法]
关注...
[解决办法]
启动程序倒是非常简单,用Process.Start("路径",null)就可以启动了。
如果要执行窗体中的某个事件的话,那比较复杂,在VB中还可以向指定串口发送指定快捷键,以出发相应按钮的事件。
C#中好像比较复杂,而且如果按钮没有快捷键的话,就比较麻烦。我觉得如果要实现的话,应该要用到API函数,先是用FindWindowsEx函数来查找窗体,然后找到你要触发按钮事件的按钮的句柄,再触发一个按钮单击事件。
[解决办法]
ding
[解决办法]
ding
[解决办法]
HRESULT ExecCommand(
long cmdID,
long cmdExecOpt,
VARIANT* pInVar = NULL,
VARIANT* pOutVar = NULL
) const;
HRESULT ExecCommand(
const GUID* pGuid,
long cmdID,
long cmdExecOpt,
VARIANT* pInVar = NULL,
VARIANT* pOutVar = NULL
) const
cmdID
The command ID to be executed. For a list, see MSHTML Command Identifiers.
cmdExecOpt
Values taken from the OLECMDEXECOPT enumeration, which describe how the object should execute the command.
pInVar
The input arguments.
pOutVar
The command output.
pGuid
The GUID of the command group.
Returns S_OK on success, or an error HRESULT on failure.
[解决办法]