Added Win32 Refresh only commands and Disable Status command
This commit is contained in:
@@ -165,6 +165,13 @@ public class CommandPopupMenu extends JPopupMenu {
|
|||||||
CommandMenuItem mntmForceRefresh = new CommandMenuItem("forceRefresh", 1, false);
|
CommandMenuItem mntmForceRefresh = new CommandMenuItem("forceRefresh", 1, false);
|
||||||
add(mntmForceRefresh);
|
add(mntmForceRefresh);
|
||||||
|
|
||||||
|
CommandMenuItem mntmForcewin32Refresh = new CommandMenuItem("forceWin32Refresh", 1, false);
|
||||||
|
add(mntmForcewin32Refresh);
|
||||||
|
|
||||||
|
CommandMenuItem mntmOnlyRefreshWin32 = new CommandMenuItem("onlyRefreshWin32", 2, false);
|
||||||
|
add(mntmOnlyRefreshWin32);
|
||||||
|
|
||||||
|
|
||||||
CommandMenuItem mntmOpen = new CommandMenuItem("open", 2, false);
|
CommandMenuItem mntmOpen = new CommandMenuItem("open", 2, false);
|
||||||
add(mntmOpen);
|
add(mntmOpen);
|
||||||
|
|
||||||
|
|||||||
@@ -279,6 +279,10 @@ public class CommandProcessor implements Runnable{
|
|||||||
return main.cmdDisableStatus(args);
|
return main.cmdDisableStatus(args);
|
||||||
if (command.equals("forceRefresh"))
|
if (command.equals("forceRefresh"))
|
||||||
return main.cmdForceRefresh(args);
|
return main.cmdForceRefresh(args);
|
||||||
|
if (command.equals("forceWin32Refresh"))
|
||||||
|
return main.cmdForceWin32Refresh(args);
|
||||||
|
if (command.equals("onlyRefreshWin32"))
|
||||||
|
return main.cmdOnlyRefreshWin32(args);
|
||||||
if (command.equals("setSpeed"))
|
if (command.equals("setSpeed"))
|
||||||
return main.cmdSetSpeed(args);
|
return main.cmdSetSpeed(args);
|
||||||
if (command.equals("setTimeout"))
|
if (command.equals("setTimeout"))
|
||||||
|
|||||||
@@ -78,6 +78,20 @@ public class WindowsEnumeratedXml implements Runnable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getXml() {
|
public static String getXml() {
|
||||||
|
final Map<String, WindowInfo> infoList = getWin32XmlMap();
|
||||||
|
|
||||||
|
//process all windows that have been flagged for uiaBridge (useUiaBridge == true)
|
||||||
|
appendUiaBridgeWindows(infoList);
|
||||||
|
|
||||||
|
return generateWindowsXml(infoList, "EnumeratedWindows");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getWin32Xml() {
|
||||||
|
final Map<String, WindowInfo> infoList = getWin32XmlMap();
|
||||||
|
return generateWindowsXml(infoList, "EnumeratedWindows");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<String, WindowInfo> getWin32XmlMap() {
|
||||||
final Map<String, WindowInfo> infoList = new LinkedHashMap<String, WindowInfo>();
|
final Map<String, WindowInfo> infoList = new LinkedHashMap<String, WindowInfo>();
|
||||||
|
|
||||||
HWND desktopRootHwnd = Api.User32Ex.instance.GetDesktopWindow();
|
HWND desktopRootHwnd = Api.User32Ex.instance.GetDesktopWindow();
|
||||||
@@ -95,11 +109,7 @@ public class WindowsEnumeratedXml implements Runnable{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Api.User32Ex.instance.EnumWindows(new ParentWindowCallback(), 0);
|
Api.User32Ex.instance.EnumWindows(new ParentWindowCallback(), 0);
|
||||||
|
return infoList;
|
||||||
//process all windows that have been flagged for uiaBridge (useUiaBridge == true)
|
|
||||||
appendUiaBridgeWindows(infoList);
|
|
||||||
|
|
||||||
return generateWindowsXml(infoList, "EnumeratedWindows");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void appendUiaBridgeWindows(Map<String, WindowInfo> infoList)
|
public static void appendUiaBridgeWindows(Map<String, WindowInfo> infoList)
|
||||||
|
|||||||
@@ -107,6 +107,15 @@ public class BaseCommand {
|
|||||||
WIN_XML = WindowsEnumeratedXml.getXml();
|
WIN_XML = WindowsEnumeratedXml.getXml();
|
||||||
LAST_UPDATED_XML = System.nanoTime();
|
LAST_UPDATED_XML = System.nanoTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void forceWin32OnlyXmlRefresh() {
|
||||||
|
WIN_XML = WindowsEnumeratedXml.getWin32Xml();
|
||||||
|
LAST_UPDATED_XML = System.nanoTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onlyRefreshWin32(boolean flg) {
|
||||||
|
SynthuseDlg.config.disableUiaBridge = flg + "";
|
||||||
|
}
|
||||||
|
|
||||||
public void targetXmlRefresh(String xpath) {
|
public void targetXmlRefresh(String xpath) {
|
||||||
if (WIN_XML.isEmpty()) //can't target refresh unless there is XML to start with
|
if (WIN_XML.isEmpty()) //can't target refresh unless there is XML to start with
|
||||||
|
|||||||
@@ -76,6 +76,21 @@ public class MainCommands extends BaseCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean cmdForceWin32Refresh(String[] args) {
|
||||||
|
if (!checkArgumentLength(args, 0))
|
||||||
|
return false;
|
||||||
|
forceWin32OnlyXmlRefresh();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean cmdOnlyRefreshWin32(String[] args) {
|
||||||
|
if (!checkArgumentLength(args, 1))
|
||||||
|
return false;
|
||||||
|
boolean flg = Boolean.parseBoolean(args[0]);
|
||||||
|
onlyRefreshWin32(flg);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean cmdTargetRefresh(String[] args) {
|
public boolean cmdTargetRefresh(String[] args) {
|
||||||
if (!checkArgumentLength(args, 1))
|
if (!checkArgumentLength(args, 1))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user