使用全局钩子和UI Automation做自动测试,抛出异常
在使用全局钩子WH_MOUSE_LL来截获鼠标点击的消息,之后根据坐标使用AutomationElement.FromPoint(point)函数来获取元素,但是会抛出异常,异常为:
An outgoing call cannot be made since the application is dispatching an input-synchronous call. (Exception from HRESULT: 0x8001010D (RPC_E_CANTCALLOUT_ININPUTSYNCCALL))
不知道是为什么????