WPF and regular Win32 windows are now supported

Added support for dragging target on WPF windows and building simple
xpath statements.  Fixed some null results in native library and
increased performance of enumerating wpf windows.  Still need to tweak
filters for picking up Silverlight handles too.
This commit is contained in:
Edward Jakubowski
2014-04-07 22:19:47 -04:00
parent 1809e2ad55
commit bc3c070ea8
20 changed files with 500 additions and 157 deletions

View File

@@ -95,12 +95,14 @@ public class SynthuseDlg extends JFrame {
public static Config config = new Config(Config.DEFAULT_PROP_FILENAME);
private String dialogResult = "";
private String lastDragHwnd = "";
private String lastRuntimeId ="";
private JComboBox<String> cmbXpath;
private JButton btnTestIde;
private TestIdeFrame testIde = null;
private int targetX;
private int targetY;
private WpfBridge wpf = new WpfBridge();
/**
* Launch the application.
@@ -423,16 +425,17 @@ public class SynthuseDlg extends JFrame {
String handleStr = Api.GetHandleAsString(hwnd);
String classStr = WindowsEnumeratedXml.escapeXmlAttributeValue(Api.GetWindowClassName(hwnd));
String parentStr = Api.GetHandleAsString(User32.instance.GetParent(hwnd));
lblStatus.setText("class: " + classStr + " hWnd: " + handleStr + " parent: " + parentStr + " X,Y: " + targetX + ", " + targetY);
if (!lastDragHwnd.equals(handleStr)) {
String runtimeId = wpf.getRuntimeIdFromPoint(targetX, targetY);
lblStatus.setText("rid:" + runtimeId + " class: " + classStr + " hWnd: " + handleStr + " parent: " + parentStr + " X,Y: " + targetX + ", " + targetY);
if (!lastDragHwnd.equals(handleStr) || !lastRuntimeId.equals(runtimeId)) {
if (!lastDragHwnd.isEmpty()) {
Api.refreshWindow(Api.GetHandleFromString(lastDragHwnd));
}
lastDragHwnd = handleStr;
lastRuntimeId = runtimeId;
//lastDragHwnd = (hwnd + "");
Api.highlightWindow(hwnd);
XpathManager.buildXpathStatementThreaded(hwnd, textPane, xpathEvents);
XpathManager.buildXpathStatementThreaded(hwnd, runtimeId, textPane, xpathEvents);
}
}
}