Philippe Galipeau

I write an application tester that register events and replay them.

I have a dialog box and when I press enter this action close the dialog box but the button OK never received the Invoke event because this accelerator action was grabbed by the application and the application close the dialog.

I want to intercept an event for this accelerator and when I need to replay my script, I want to send this event to the dialog.

How I can do that

Thanks

 

Another exemple, when the user press a key into a grid a dialog popup.

I need to trap a keyboard event, How I do that



Re: Microsoft UI Automation How I can capture accelerator key (action ) with automation?

stuartaw

I don't think UIA is enough to detect all the events going to the application. Are you also writing the application that is being tested If so it is probably easiest to modify it to report the events.

If not, you can intercept many Windows events with SetWindowsHookEx. I've only used this for key intercepts, but I think you can use it for other events. Relating the information you would get from this back to UIA is going to be difficult.


Stuart




Re: Microsoft UI Automation How I can capture accelerator key (action ) with automation?

Philippe Galipeau

Thanks for your answer,

I thought there is another way under vista to intercept key event.

And I thought the function SetWindowsHookEx will not be supported under vista but I saw on the net that I can use this function if my application run on administrative level.