Added SelectContextMenuId Command, increasing uiabridge speeds, reliability

This commit is contained in:
Edward Jakubowski
2014-05-02 22:01:43 -04:00
parent ce78f9c084
commit 4258d0977f
19 changed files with 185 additions and 65 deletions

View File

@@ -122,6 +122,22 @@ public class WindowsCommands extends BaseCommand {
//LRESULT result =
//System.out.println("PostMessage to " + handle.hWndStr + " for id " + id);
api.user32.PostMessage(handle.hWnd, Api.WM_COMMAND, new WPARAM(id), new LPARAM(0));
//api.user32.SendMessage(handle.hWnd, Api.WM_COMMAND, new WPARAM(id), new LPARAM(0));
return true;
}
public boolean cmdSelectContextMenuId(String[] args) {
if (!checkArgumentLength(args, 2))
return false;
WinPtr handle = findHandleWithXpath(args[0]); //xpath to HWND is first argument
if (handle.isEmpty())
return false;
int id = Integer.parseInt(args[1]); //context menu id is supplied as second argument
//LRESULT result =
System.out.println("PostMessage to " + handle.toString() + " for id " + id + " - " + Api.MAKELONG(id, 0));
//api.user32.PostMessage(handle.hWnd, Api.WM_COMMAND, new WPARAM(id), new LPARAM(0));
api.user32.SendMessage(handle.hWnd, Api.WM_COMMAND, new WPARAM(Api.MAKELONG(id, 0)), new LPARAM(0));
return true;
}
}