
Untitled
By: a guest on
Jun 30th, 2012 | syntax:
None | size: 0.61 KB | hits: 15 | expires: Never
Identifier for a Windows GUI element (AutomationElement HashCode and RuntimeID)
using System.Window.Automation;
private AutomationElement element;
System.Drawing.Point mouse = System.Windows.Forms.Cursor.Position;
this.element = AutomationElement.FromPoint(new System.Windows.Point(mouse.X, mouse.Y));
[DllImport("User32.dll")]
public static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);
private string GetClassName(IntPtr hWnd)
{
StringBuilder sb = new StringBuilder(256);
this.GetClassName(hWnd, sb, 256);
return sb.ToString();
}