public class MenuUtilities extends NativeWrapper
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_NAME |
static int |
MAX_MENU_ITEM_LEN |
static int |
MF_BITMAP |
static int |
MF_BYCOMMAND |
static int |
MF_BYPOSITION |
static int |
MF_CHECKED |
static int |
MF_DEFAULT |
static int |
MF_DISABLED |
static int |
MF_GRAYED |
static int |
MF_HILITE |
static int |
MF_MENUBARBREAK |
static int |
MF_MENUBREAK |
static int |
MF_OWNERDRAW |
static int |
MF_POPUP |
static int |
MF_SEPARATOR |
static int |
MU_STATE_FAILURE |
static java.lang.String |
MUStateFailureString |
ARG_FILE_FOR_GETTIME, ARG_HOSTNAME, COMMAND_HOSTNMAE, COMMAND_IFCONFIG, COMMAND_IPCONFIG, COMMAND_PING, DIRECTORY_SBIN, NO_RESULT, PARAM_HOSTNMAE_f, REG_BINARY, REG_DWORD, REG_EXPAND_SZ, REG_MULTI_SZ, REG_NONE, REG_QWORD, REG_SZ, RESULT_KEY, VECTOR_KEY
Constructor and Description |
---|
MenuUtilities() |
Modifier and Type | Method and Description |
---|---|
void |
checkState(int state)
Users can call this method to check the state before they call the other
methods IsXXX()
|
static boolean |
IsMenuItemABitmap(int state) |
static boolean |
IsMenuItemAMenu(int state) |
static boolean |
IsMenuItemAMenuBarBreak(int state) |
static boolean |
IsMenuItemAMenuBreak(int state) |
static boolean |
IsMenuItemAMenuSeparator(int state) |
static boolean |
IsMenuItemChecked(int state) |
static boolean |
IsMenuItemDefault(int state) |
static boolean |
IsMenuItemEnabled(int state) |
static boolean |
IsMenuItemGrayed(int state) |
static boolean |
IsMenuItemHiLited(int state) |
static java.lang.String |
MUGetMenuItemStateString(int state)
DESCRIPTION:
Given state information of the state obtained by User32.GetMenuState(NativeLong, int, int)
the routine converts it to a space-delimited string of all the state
information known for the provided state. |
static java.util.List<java.lang.String> |
MUGetMenuItemStrings(long lhMenu)
DESCRIPTION:
Given a valid Menu handle and return a list of all the menuitems.
|
static int |
MUGetMenuItemTextIndex(long hMenu,
java.lang.String menuText)
DESCRIPTION:
Given a valid Menu handle and text string the routine attempts to
locate the position within the menu for the associated menuitem.
|
static long |
MUGetMenuItemTextState(long hMenu,
java.lang.String menuText)
DESCRIPTION:
Given a valid Menu handle and text string the routine attempts to
return the state information for the menuitem.
|
static boolean |
MUOutputMenuStructure(long lhWnd,
java.lang.String path,
boolean overwrite,
boolean recurse,
boolean showState,
java.lang.String description)
DESCRIPTION:
Given a valid handle the routine retrieves the menu structure, formats
it as text, and saves it to a file or outputs it to the Console.
|
_processLastError, DoesRegistryKeyExist, EnumChildWindows, EnumWindows, execute, GetDesktopWindow, getFileTime, GetForegroundWindow, getHostIPByPing, getLocalHostIPByConfig, getLocalHostName, GetProcessFileName, GetProcessUIResourceCount, GetRegistryKeyValue, GetSystemEnvironmentVariable, GetWindowThreadProcessId, ifconfig, ipconfig, LaunchURLInDefaultWebBrowser, main, ping, RemoveRegistryKeyValue, RemoveSystemEnvironmentVariable, runAsynchBatchProcess, runAsynchExec, runShortProcessAndWait, SetForegroundWindow, SetRegistryKeyValue, SetSystemEnvironmentVariable
public static final int MU_STATE_FAILURE
public static final int MF_CHECKED
public static final int MF_DISABLED
public static final int MF_GRAYED
public static final int MF_HILITE
public static final int MF_MENUBARBREAK
public static final int MF_MENUBREAK
public static final int MF_OWNERDRAW
public static final int MF_POPUP
public static final int MF_BITMAP
public static final int MF_SEPARATOR
public static final int MF_DEFAULT
public static final int MF_BYCOMMAND
public static final int MF_BYPOSITION
public static final java.lang.String MUStateFailureString
public static final java.lang.String CLASS_NAME
public static final int MAX_MENU_ITEM_LEN
public void checkState(int state) throws SAFSException
SAFSException
public static boolean IsMenuItemEnabled(int state)
public static boolean IsMenuItemChecked(int state)
public static boolean IsMenuItemGrayed(int state)
public static boolean IsMenuItemHiLited(int state)
public static boolean IsMenuItemDefault(int state)
public static boolean IsMenuItemABitmap(int state)
public static boolean IsMenuItemAMenuBreak(int state)
public static boolean IsMenuItemAMenuBarBreak(int state)
public static boolean IsMenuItemAMenuSeparator(int state)
public static boolean IsMenuItemAMenu(int state)
public static java.lang.String MUGetMenuItemStateString(int state)
User32.GetMenuState(NativeLong, int, int)
the routine converts it to a space-delimited string of all the state
information known for the provided state. Ex:
"Enabled Unchecked Ungrayed Unhilited Default" OR
"Enabled Unchecked Ungrayed Hilited Normal Menu With 5 MenuItems"
Valid States:
Enabled Grayed BarBreak Bitmap
Disabled Ungrayed Separator Break
Checked Hilited Default Menu With N MenuItems
Unchecked Unhilited Normal (not default)state
- state information retrieved from User32.GetMenuState(NativeLong, int, int)
MU_STATE_FAILURE
then return MUStateFailureString
public static long MUGetMenuItemTextState(long hMenu, java.lang.String menuText)
hMenu
- The handle of the MenumenuText
- Case-sensitive text to identify the menuitem withMUStateFailureString
on failure.public static int MUGetMenuItemTextIndex(long hMenu, java.lang.String menuText)
hMenu
- The handle of the MenumenuText
- Case-sensitive text to identify the menuitem withpublic static java.util.List<java.lang.String> MUGetMenuItemStrings(long lhMenu)
lhMenu
- The handle of the Menupublic static boolean MUOutputMenuStructure(long lhWnd, java.lang.String path, boolean overwrite, boolean recurse, boolean showState, java.lang.String description)
lhWnd
- handle of the Windowpath
- full path and name of file to use/make as output
if path="" the output is directed to the consoleoverwrite
- false Append the file if it already exists
true Overwrite the file if it already existsrecurse
- false Output only the top level menu information
true Recursively output ALL menu informationshowState
- false Do not show any state information
true Show the state string of each menuitemdescription
- Optional text to place at start of output
This should be something which identifies which window
or which state of the application the snapshot was
taken from. Without this, the output gives no indication
of where it came from.Copyright © SAS Institute. All Rights Reserved.