How to determine the position of a WPF window control in another process?
<p>How do I determine the position a WPF window control in another process? The following code return source=null, therefore I can't traverse through all controls to find and determine the control position.</p>

<pre><code>Process[] procs = Process.GetProcesses();
        foreach(Process p in procs)
        {
            if (p.MainWindowHandle != null)
            {
                StringBuilder sb = new StringBuilder(257);
                RealGetWindowClass(p.MainWindowHandle, sb, 256);
                if(sb.ToString().StartsWith("HwndWrapper"))
                {
                    System.Windows.Interop.HwndSource source = System.Windows.Interop.HwndSource.FromHwnd(p.MainWindowHandle);
                    EnumVisual(source.RootVisual);
                }
            }
        }
</code></pre>
