I have an AutomationElement for a particular WPF Button in an external application from the WPF application that I am try to access. Is there a way to find out the button's IsDefault property?
I have tried to access the button's window's control through its handle, using (Window)HwndSource.FromHwnd(hWnd).RootVisual
,where hWnd is the button's window's NativeWindowHandle
, but FromHwnd
returns null.
Normally, you can't access a WPF control object in another process. You might be able to do something with a tool like Snoop. In this particular case, I see that when I set IsDefault to true, the AccessKey property on the button's automation element is "\r". Otherwise it is empty ("").