private void MouseHook_MouseMove(MouseHook.MSLLHOOKSTRUCT mouseStruct) { /* * System.Windows.Point point = new System.Windows.Point(); * point.X = mouseStruct.pt.x; * point.Y = mouseStruct.pt.y; * * AutomationElement ae1 = AutomationElement.FromPoint(point); * * if(ae1 != aeRemains && ae1 != null) * { * IntPtr dc = GetDC((IntPtr)ae1.Current.NativeWindowHandle); * * Graphics newGraphics = Graphics.FromHdc(dc); * //newGraphics.Dispose(); * aeRemains = ae1; * * Rect rect = aeRemains.Current.BoundingRectangle; * * * newGraphics.DrawRectangle(new Pen(Color.Red, 3),(float)rect.X , (float)rect.Y , (float)rect.Width , (float)rect.Height); * newGraphics.Dispose(); * } */ }
private void MouseHook_LeftButtonDown(MouseHook.MSLLHOOKSTRUCT mouseStruct) { System.Windows.Point point = new System.Windows.Point(); point.X = mouseStruct.pt.x; point.Y = mouseStruct.pt.y; mouseHook.Uninstall(); AutomationElement ae = AutomationElement.FromPoint(point); Stack <AutomationElement> automationElements = XmlController.MakeStack(ae); String result = XmlController.MakeXmlFile(automationElements, 0, null); mainWindow.XmlBox.Text = result; mainWindow.Activate(); }
private void MouseHook_LeftButtonDown(MouseHook.MSLLHOOKSTRUCT mouseStruct) { Point point = new Point(mouseStruct.pt.x, mouseStruct.pt.y); Add add = new Add(AddList); IAsyncResult result = add.BeginInvoke(point, 1, null, null); }