I have the following code
IUIAutomationInvokePattern* invoke_button = 0; button->GetCurrentPatternAs(UIA_InvokePatternId, IID_PPV_ARGS(&invoke_button)); i