partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
valid
Evolutionary.tf_step
Creates the TensorFlow operations for performing an optimization step. Args: time: Time tensor. variables: List of variables to optimize. arguments: Dict of arguments for callables, like fn_loss. fn_loss: A callable returning the loss of the current model. ...
tensorforce/core/optimizers/evolutionary.py
def tf_step( self, time, variables, arguments, fn_loss, **kwargs ): """ Creates the TensorFlow operations for performing an optimization step. Args: time: Time tensor. variables: List of variables to optimize. ...
def tf_step( self, time, variables, arguments, fn_loss, **kwargs ): """ Creates the TensorFlow operations for performing an optimization step. Args: time: Time tensor. variables: List of variables to optimize. ...
[ "Creates", "the", "TensorFlow", "operations", "for", "performing", "an", "optimization", "step", "." ]
tensorforce/tensorforce
python
https://github.com/tensorforce/tensorforce/blob/520a8d992230e382f08e315ede5fc477f5e26bfb/tensorforce/core/optimizers/evolutionary.py#L52-L132
[ "def", "tf_step", "(", "self", ",", "time", ",", "variables", ",", "arguments", ",", "fn_loss", ",", "*", "*", "kwargs", ")", ":", "unperturbed_loss", "=", "fn_loss", "(", "*", "*", "arguments", ")", "# First sample", "perturbations", "=", "[", "tf", "."...
520a8d992230e382f08e315ede5fc477f5e26bfb
valid
GlobalOptimizer.tf_step
Keyword Args: global_variables: List of global variables to apply the proposed optimization step to. Returns: List of delta tensors corresponding to the updates for each optimized variable.
tensorforce/core/optimizers/global_optimizer.py
def tf_step(self, time, variables, **kwargs): """ Keyword Args: global_variables: List of global variables to apply the proposed optimization step to. Returns: List of delta tensors corresponding to the updates for each optimized variable. """ global_var...
def tf_step(self, time, variables, **kwargs): """ Keyword Args: global_variables: List of global variables to apply the proposed optimization step to. Returns: List of delta tensors corresponding to the updates for each optimized variable. """ global_var...
[ "Keyword", "Args", ":", "global_variables", ":", "List", "of", "global", "variables", "to", "apply", "the", "proposed", "optimization", "step", "to", "." ]
tensorforce/tensorforce
python
https://github.com/tensorforce/tensorforce/blob/520a8d992230e382f08e315ede5fc477f5e26bfb/tensorforce/core/optimizers/global_optimizer.py#L44-L76
[ "def", "tf_step", "(", "self", ",", "time", ",", "variables", ",", "*", "*", "kwargs", ")", ":", "global_variables", "=", "kwargs", "[", "\"global_variables\"", "]", "assert", "all", "(", "util", ".", "shape", "(", "global_variable", ")", "==", "util", "...
520a8d992230e382f08e315ede5fc477f5e26bfb
valid
KFAC.computeStatsEigen
compute the eigen decomp using copied var stats to avoid concurrent read/write from other queue
tensorforce/core/optimizers/kfac.py
def computeStatsEigen(self): """ compute the eigen decomp using copied var stats to avoid concurrent read/write from other queue """ # TO-DO: figure out why this op has delays (possibly moving # eigenvectors around?) with tf.device('/cpu:0'): def removeNone(tensor_list): ...
def computeStatsEigen(self): """ compute the eigen decomp using copied var stats to avoid concurrent read/write from other queue """ # TO-DO: figure out why this op has delays (possibly moving # eigenvectors around?) with tf.device('/cpu:0'): def removeNone(tensor_list): ...
[ "compute", "the", "eigen", "decomp", "using", "copied", "var", "stats", "to", "avoid", "concurrent", "read", "/", "write", "from", "other", "queue" ]
tensorforce/tensorforce
python
https://github.com/tensorforce/tensorforce/blob/520a8d992230e382f08e315ede5fc477f5e26bfb/tensorforce/core/optimizers/kfac.py#L550-L606
[ "def", "computeStatsEigen", "(", "self", ")", ":", "# TO-DO: figure out why this op has delays (possibly moving", "# eigenvectors around?)", "with", "tf", ".", "device", "(", "'/cpu:0'", ")", ":", "def", "removeNone", "(", "tensor_list", ")", ":", "local_list", "=", "...
520a8d992230e382f08e315ede5fc477f5e26bfb
valid
KFAC.tf_step
Creates the TensorFlow operations for performing an optimization step on the given variables, including actually changing the values of the variables. Args: time: Time tensor. Not used for this optimizer. variables: List of variables to optimize. **kwargs: ...
tensorforce/core/optimizers/kfac.py
def tf_step(self, time, variables, **kwargs): """ Creates the TensorFlow operations for performing an optimization step on the given variables, including actually changing the values of the variables. Args: time: Time tensor. Not used for this optimizer. variable...
def tf_step(self, time, variables, **kwargs): """ Creates the TensorFlow operations for performing an optimization step on the given variables, including actually changing the values of the variables. Args: time: Time tensor. Not used for this optimizer. variable...
[ "Creates", "the", "TensorFlow", "operations", "for", "performing", "an", "optimization", "step", "on", "the", "given", "variables", "including", "actually", "changing", "the", "values", "of", "the", "variables", "." ]
tensorforce/tensorforce
python
https://github.com/tensorforce/tensorforce/blob/520a8d992230e382f08e315ede5fc477f5e26bfb/tensorforce/core/optimizers/kfac.py#L918-L935
[ "def", "tf_step", "(", "self", ",", "time", ",", "variables", ",", "*", "*", "kwargs", ")", ":", "fn_loss", "=", "kwargs", "[", "\"fn_loss\"", "]", "if", "variables", "is", "None", ":", "variables", "=", "tf", ".", "trainable_variables", "return", "tf", ...
520a8d992230e382f08e315ede5fc477f5e26bfb
valid
KFAC.apply_step
Applies the given (and already calculated) step deltas to the variable values. Args: variables: List of variables. deltas: List of deltas of same length. loss_sampled : the sampled loss Returns: The step-applied operation. A tf.group of tf.assign_add ops...
tensorforce/core/optimizers/kfac.py
def apply_step(self, variables, deltas, loss_sampled): """ Applies the given (and already calculated) step deltas to the variable values. Args: variables: List of variables. deltas: List of deltas of same length. loss_sampled : the sampled loss Retur...
def apply_step(self, variables, deltas, loss_sampled): """ Applies the given (and already calculated) step deltas to the variable values. Args: variables: List of variables. deltas: List of deltas of same length. loss_sampled : the sampled loss Retur...
[ "Applies", "the", "given", "(", "and", "already", "calculated", ")", "step", "deltas", "to", "the", "variable", "values", "." ]
tensorforce/tensorforce
python
https://github.com/tensorforce/tensorforce/blob/520a8d992230e382f08e315ede5fc477f5e26bfb/tensorforce/core/optimizers/kfac.py#L937-L953
[ "def", "apply_step", "(", "self", ",", "variables", ",", "deltas", ",", "loss_sampled", ")", ":", "update_stats_op", "=", "self", ".", "compute_and_apply_stats", "(", "loss_sampled", ",", "var_list", "=", "var_list", ")", "grads", "=", "[", "(", "a", ",", ...
520a8d992230e382f08e315ede5fc477f5e26bfb
valid
KFAC.minimize
Performs an optimization step. Args: time: Time tensor. Not used for this variables: List of variables to optimize. **kwargs: fn_loss : loss function tensor that is differentiated sampled_loss : the sampled loss from running the model. ...
tensorforce/core/optimizers/kfac.py
def minimize(self, time, variables, **kwargs): """ Performs an optimization step. Args: time: Time tensor. Not used for this variables: List of variables to optimize. **kwargs: fn_loss : loss function tensor that is differentiated ...
def minimize(self, time, variables, **kwargs): """ Performs an optimization step. Args: time: Time tensor. Not used for this variables: List of variables to optimize. **kwargs: fn_loss : loss function tensor that is differentiated ...
[ "Performs", "an", "optimization", "step", "." ]
tensorforce/tensorforce
python
https://github.com/tensorforce/tensorforce/blob/520a8d992230e382f08e315ede5fc477f5e26bfb/tensorforce/core/optimizers/kfac.py#L955-L973
[ "def", "minimize", "(", "self", ",", "time", ",", "variables", ",", "*", "*", "kwargs", ")", ":", "loss", "=", "kwargs", "[", "\"fn_loss\"", "]", "sampled_loss", "=", "kwargs", "[", "\"sampled_loss\"", "]", "min_op", ",", "_", "=", "self", ".", "minimi...
520a8d992230e382f08e315ede5fc477f5e26bfb
valid
QDemoModel.setup_components_and_tf_funcs
Constructs the extra Replay memory.
tensorforce/models/q_demo_model.py
def setup_components_and_tf_funcs(self, custom_getter=None): """ Constructs the extra Replay memory. """ custom_getter = super(QDemoModel, self).setup_components_and_tf_funcs(custom_getter) self.demo_memory = Replay( states=self.states_spec, internals=sel...
def setup_components_and_tf_funcs(self, custom_getter=None): """ Constructs the extra Replay memory. """ custom_getter = super(QDemoModel, self).setup_components_and_tf_funcs(custom_getter) self.demo_memory = Replay( states=self.states_spec, internals=sel...
[ "Constructs", "the", "extra", "Replay", "memory", "." ]
tensorforce/tensorforce
python
https://github.com/tensorforce/tensorforce/blob/520a8d992230e382f08e315ede5fc477f5e26bfb/tensorforce/models/q_demo_model.py#L103-L147
[ "def", "setup_components_and_tf_funcs", "(", "self", ",", "custom_getter", "=", "None", ")", ":", "custom_getter", "=", "super", "(", "QDemoModel", ",", "self", ")", ".", "setup_components_and_tf_funcs", "(", "custom_getter", ")", "self", ".", "demo_memory", "=", ...
520a8d992230e382f08e315ede5fc477f5e26bfb
valid
QDemoModel.tf_import_demo_experience
Imports a single experience to memory.
tensorforce/models/q_demo_model.py
def tf_import_demo_experience(self, states, internals, actions, terminal, reward): """ Imports a single experience to memory. """ return self.demo_memory.store( states=states, internals=internals, actions=actions, terminal=terminal, ...
def tf_import_demo_experience(self, states, internals, actions, terminal, reward): """ Imports a single experience to memory. """ return self.demo_memory.store( states=states, internals=internals, actions=actions, terminal=terminal, ...
[ "Imports", "a", "single", "experience", "to", "memory", "." ]
tensorforce/tensorforce
python
https://github.com/tensorforce/tensorforce/blob/520a8d992230e382f08e315ede5fc477f5e26bfb/tensorforce/models/q_demo_model.py#L153-L163
[ "def", "tf_import_demo_experience", "(", "self", ",", "states", ",", "internals", ",", "actions", ",", "terminal", ",", "reward", ")", ":", "return", "self", ".", "demo_memory", ".", "store", "(", "states", "=", "states", ",", "internals", "=", "internals", ...
520a8d992230e382f08e315ede5fc477f5e26bfb
valid
QDemoModel.tf_demo_loss
Extends the q-model loss via the dqfd large-margin loss.
tensorforce/models/q_demo_model.py
def tf_demo_loss(self, states, actions, terminal, reward, internals, update, reference=None): """ Extends the q-model loss via the dqfd large-margin loss. """ embedding = self.network.apply(x=states, internals=internals, update=update) deltas = list() for name in sorted(...
def tf_demo_loss(self, states, actions, terminal, reward, internals, update, reference=None): """ Extends the q-model loss via the dqfd large-margin loss. """ embedding = self.network.apply(x=states, internals=internals, update=update) deltas = list() for name in sorted(...
[ "Extends", "the", "q", "-", "model", "loss", "via", "the", "dqfd", "large", "-", "margin", "loss", "." ]
tensorforce/tensorforce
python
https://github.com/tensorforce/tensorforce/blob/520a8d992230e382f08e315ede5fc477f5e26bfb/tensorforce/models/q_demo_model.py#L165-L204
[ "def", "tf_demo_loss", "(", "self", ",", "states", ",", "actions", ",", "terminal", ",", "reward", ",", "internals", ",", "update", ",", "reference", "=", "None", ")", ":", "embedding", "=", "self", ".", "network", ".", "apply", "(", "x", "=", "states"...
520a8d992230e382f08e315ede5fc477f5e26bfb
valid
QDemoModel.tf_combined_loss
Combines Q-loss and demo loss.
tensorforce/models/q_demo_model.py
def tf_combined_loss(self, states, internals, actions, terminal, reward, next_states, next_internals, update, reference=None): """ Combines Q-loss and demo loss. """ q_model_loss = self.fn_loss( states=states, internals=internals, actions=actions, ...
def tf_combined_loss(self, states, internals, actions, terminal, reward, next_states, next_internals, update, reference=None): """ Combines Q-loss and demo loss. """ q_model_loss = self.fn_loss( states=states, internals=internals, actions=actions, ...
[ "Combines", "Q", "-", "loss", "and", "demo", "loss", "." ]
tensorforce/tensorforce
python
https://github.com/tensorforce/tensorforce/blob/520a8d992230e382f08e315ede5fc477f5e26bfb/tensorforce/models/q_demo_model.py#L206-L232
[ "def", "tf_combined_loss", "(", "self", ",", "states", ",", "internals", ",", "actions", ",", "terminal", ",", "reward", ",", "next_states", ",", "next_internals", ",", "update", ",", "reference", "=", "None", ")", ":", "q_model_loss", "=", "self", ".", "f...
520a8d992230e382f08e315ede5fc477f5e26bfb
valid
QDemoModel.get_variables
Returns the TensorFlow variables used by the model. Returns: List of variables.
tensorforce/models/q_demo_model.py
def get_variables(self, include_submodules=False, include_nontrainable=False): """ Returns the TensorFlow variables used by the model. Returns: List of variables. """ model_variables = super(QDemoModel, self).get_variables( include_submodules=include_subm...
def get_variables(self, include_submodules=False, include_nontrainable=False): """ Returns the TensorFlow variables used by the model. Returns: List of variables. """ model_variables = super(QDemoModel, self).get_variables( include_submodules=include_subm...
[ "Returns", "the", "TensorFlow", "variables", "used", "by", "the", "model", "." ]
tensorforce/tensorforce
python
https://github.com/tensorforce/tensorforce/blob/520a8d992230e382f08e315ede5fc477f5e26bfb/tensorforce/models/q_demo_model.py#L299-L315
[ "def", "get_variables", "(", "self", ",", "include_submodules", "=", "False", ",", "include_nontrainable", "=", "False", ")", ":", "model_variables", "=", "super", "(", "QDemoModel", ",", "self", ")", ".", "get_variables", "(", "include_submodules", "=", "includ...
520a8d992230e382f08e315ede5fc477f5e26bfb
valid
QDemoModel.import_demo_experience
Stores demonstrations in the demo memory.
tensorforce/models/q_demo_model.py
def import_demo_experience(self, states, internals, actions, terminal, reward): """ Stores demonstrations in the demo memory. """ fetches = self.import_demo_experience_output feed_dict = self.get_feed_dict( states=states, internals=internals, ...
def import_demo_experience(self, states, internals, actions, terminal, reward): """ Stores demonstrations in the demo memory. """ fetches = self.import_demo_experience_output feed_dict = self.get_feed_dict( states=states, internals=internals, ...
[ "Stores", "demonstrations", "in", "the", "demo", "memory", "." ]
tensorforce/tensorforce
python
https://github.com/tensorforce/tensorforce/blob/520a8d992230e382f08e315ede5fc477f5e26bfb/tensorforce/models/q_demo_model.py#L317-L331
[ "def", "import_demo_experience", "(", "self", ",", "states", ",", "internals", ",", "actions", ",", "terminal", ",", "reward", ")", ":", "fetches", "=", "self", ".", "import_demo_experience_output", "feed_dict", "=", "self", ".", "get_feed_dict", "(", "states", ...
520a8d992230e382f08e315ede5fc477f5e26bfb
valid
QDemoModel.demo_update
Performs a demonstration update by calling the demo optimization operation. Note that the batch data does not have to be fetched from the demo memory as this is now part of the TensorFlow operation of the demo update.
tensorforce/models/q_demo_model.py
def demo_update(self): """ Performs a demonstration update by calling the demo optimization operation. Note that the batch data does not have to be fetched from the demo memory as this is now part of the TensorFlow operation of the demo update. """ fetches = self.demo_opt...
def demo_update(self): """ Performs a demonstration update by calling the demo optimization operation. Note that the batch data does not have to be fetched from the demo memory as this is now part of the TensorFlow operation of the demo update. """ fetches = self.demo_opt...
[ "Performs", "a", "demonstration", "update", "by", "calling", "the", "demo", "optimization", "operation", ".", "Note", "that", "the", "batch", "data", "does", "not", "have", "to", "be", "fetched", "from", "the", "demo", "memory", "as", "this", "is", "now", ...
tensorforce/tensorforce
python
https://github.com/tensorforce/tensorforce/blob/520a8d992230e382f08e315ede5fc477f5e26bfb/tensorforce/models/q_demo_model.py#L333-L341
[ "def", "demo_update", "(", "self", ")", ":", "fetches", "=", "self", ".", "demo_optimization_output", "self", ".", "monitored_session", ".", "run", "(", "fetches", "=", "fetches", ")" ]
520a8d992230e382f08e315ede5fc477f5e26bfb
valid
Solver.from_config
Creates a solver from a specification dict.
tensorforce/core/optimizers/solvers/solver.py
def from_config(config, kwargs=None): """ Creates a solver from a specification dict. """ return util.get_object( obj=config, predefined=tensorforce.core.optimizers.solvers.solvers, kwargs=kwargs )
def from_config(config, kwargs=None): """ Creates a solver from a specification dict. """ return util.get_object( obj=config, predefined=tensorforce.core.optimizers.solvers.solvers, kwargs=kwargs )
[ "Creates", "a", "solver", "from", "a", "specification", "dict", "." ]
tensorforce/tensorforce
python
https://github.com/tensorforce/tensorforce/blob/520a8d992230e382f08e315ede5fc477f5e26bfb/tensorforce/core/optimizers/solvers/solver.py#L48-L56
[ "def", "from_config", "(", "config", ",", "kwargs", "=", "None", ")", ":", "return", "util", ".", "get_object", "(", "obj", "=", "config", ",", "predefined", "=", "tensorforce", ".", "core", ".", "optimizers", ".", "solvers", ".", "solvers", ",", "kwargs...
520a8d992230e382f08e315ede5fc477f5e26bfb
valid
TFOptimizer.tf_step
Keyword Args: arguments: Dict of arguments for passing to fn_loss as **kwargs. fn_loss: A callable taking arguments as kwargs and returning the loss op of the current model.
tensorforce/core/optimizers/tf_optimizer.py
def tf_step(self, time, variables, **kwargs): """ Keyword Args: arguments: Dict of arguments for passing to fn_loss as **kwargs. fn_loss: A callable taking arguments as kwargs and returning the loss op of the current model. """ arguments = kwargs["arguments"] ...
def tf_step(self, time, variables, **kwargs): """ Keyword Args: arguments: Dict of arguments for passing to fn_loss as **kwargs. fn_loss: A callable taking arguments as kwargs and returning the loss op of the current model. """ arguments = kwargs["arguments"] ...
[ "Keyword", "Args", ":", "arguments", ":", "Dict", "of", "arguments", "for", "passing", "to", "fn_loss", "as", "**", "kwargs", ".", "fn_loss", ":", "A", "callable", "taking", "arguments", "as", "kwargs", "and", "returning", "the", "loss", "op", "of", "the",...
tensorforce/tensorforce
python
https://github.com/tensorforce/tensorforce/blob/520a8d992230e382f08e315ede5fc477f5e26bfb/tensorforce/core/optimizers/tf_optimizer.py#L53-L77
[ "def", "tf_step", "(", "self", ",", "time", ",", "variables", ",", "*", "*", "kwargs", ")", ":", "arguments", "=", "kwargs", "[", "\"arguments\"", "]", "fn_loss", "=", "kwargs", "[", "\"fn_loss\"", "]", "loss", "=", "fn_loss", "(", "*", "*", "arguments...
520a8d992230e382f08e315ede5fc477f5e26bfb
valid
SetClipboardText
Return bool, True if succeed otherwise False.
uiautomation/uiautomation.py
def SetClipboardText(text: str) -> bool: """ Return bool, True if succeed otherwise False. """ if ctypes.windll.user32.OpenClipboard(0): ctypes.windll.user32.EmptyClipboard() textByteLen = (len(text) + 1) * 2 hClipboardData = ctypes.windll.kernel32.GlobalAlloc(0, textByteLen) # ...
def SetClipboardText(text: str) -> bool: """ Return bool, True if succeed otherwise False. """ if ctypes.windll.user32.OpenClipboard(0): ctypes.windll.user32.EmptyClipboard() textByteLen = (len(text) + 1) * 2 hClipboardData = ctypes.windll.kernel32.GlobalAlloc(0, textByteLen) # ...
[ "Return", "bool", "True", "if", "succeed", "otherwise", "False", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1724-L1740
[ "def", "SetClipboardText", "(", "text", ":", "str", ")", "->", "bool", ":", "if", "ctypes", ".", "windll", ".", "user32", ".", "OpenClipboard", "(", "0", ")", ":", "ctypes", ".", "windll", ".", "user32", ".", "EmptyClipboard", "(", ")", "textByteLen", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
SetConsoleColor
Change the text color on console window. color: int, a value in class `ConsoleColor`. Return bool, True if succeed otherwise False.
uiautomation/uiautomation.py
def SetConsoleColor(color: int) -> bool: """ Change the text color on console window. color: int, a value in class `ConsoleColor`. Return bool, True if succeed otherwise False. """ global _ConsoleOutputHandle global _DefaultConsoleColor if not _DefaultConsoleColor: if not _Consol...
def SetConsoleColor(color: int) -> bool: """ Change the text color on console window. color: int, a value in class `ConsoleColor`. Return bool, True if succeed otherwise False. """ global _ConsoleOutputHandle global _DefaultConsoleColor if not _DefaultConsoleColor: if not _Consol...
[ "Change", "the", "text", "color", "on", "console", "window", ".", "color", ":", "int", "a", "value", "in", "class", "ConsoleColor", ".", "Return", "bool", "True", "if", "succeed", "otherwise", "False", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1743-L1759
[ "def", "SetConsoleColor", "(", "color", ":", "int", ")", "->", "bool", ":", "global", "_ConsoleOutputHandle", "global", "_DefaultConsoleColor", "if", "not", "_DefaultConsoleColor", ":", "if", "not", "_ConsoleOutputHandle", ":", "_ConsoleOutputHandle", "=", "ctypes", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
ResetConsoleColor
Reset to the default text color on console window. Return bool, True if succeed otherwise False.
uiautomation/uiautomation.py
def ResetConsoleColor() -> bool: """ Reset to the default text color on console window. Return bool, True if succeed otherwise False. """ if sys.stdout: sys.stdout.flush() bool(ctypes.windll.kernel32.SetConsoleTextAttribute(_ConsoleOutputHandle, _DefaultConsoleColor))
def ResetConsoleColor() -> bool: """ Reset to the default text color on console window. Return bool, True if succeed otherwise False. """ if sys.stdout: sys.stdout.flush() bool(ctypes.windll.kernel32.SetConsoleTextAttribute(_ConsoleOutputHandle, _DefaultConsoleColor))
[ "Reset", "to", "the", "default", "text", "color", "on", "console", "window", ".", "Return", "bool", "True", "if", "succeed", "otherwise", "False", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1762-L1769
[ "def", "ResetConsoleColor", "(", ")", "->", "bool", ":", "if", "sys", ".", "stdout", ":", "sys", ".", "stdout", ".", "flush", "(", ")", "bool", "(", "ctypes", ".", "windll", ".", "kernel32", ".", "SetConsoleTextAttribute", "(", "_ConsoleOutputHandle", ",",...
2cc91060982cc8b777152e698d677cc2989bf263
valid
WindowFromPoint
WindowFromPoint from Win32. Return int, a native window handle.
uiautomation/uiautomation.py
def WindowFromPoint(x: int, y: int) -> int: """ WindowFromPoint from Win32. Return int, a native window handle. """ return ctypes.windll.user32.WindowFromPoint(ctypes.wintypes.POINT(x, y))
def WindowFromPoint(x: int, y: int) -> int: """ WindowFromPoint from Win32. Return int, a native window handle. """ return ctypes.windll.user32.WindowFromPoint(ctypes.wintypes.POINT(x, y))
[ "WindowFromPoint", "from", "Win32", ".", "Return", "int", "a", "native", "window", "handle", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1772-L1777
[ "def", "WindowFromPoint", "(", "x", ":", "int", ",", "y", ":", "int", ")", "->", "int", ":", "return", "ctypes", ".", "windll", ".", "user32", ".", "WindowFromPoint", "(", "ctypes", ".", "wintypes", ".", "POINT", "(", "x", ",", "y", ")", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
GetCursorPos
GetCursorPos from Win32. Get current mouse cursor positon. Return tuple, two ints tuple (x, y).
uiautomation/uiautomation.py
def GetCursorPos() -> tuple: """ GetCursorPos from Win32. Get current mouse cursor positon. Return tuple, two ints tuple (x, y). """ point = ctypes.wintypes.POINT(0, 0) ctypes.windll.user32.GetCursorPos(ctypes.byref(point)) return point.x, point.y
def GetCursorPos() -> tuple: """ GetCursorPos from Win32. Get current mouse cursor positon. Return tuple, two ints tuple (x, y). """ point = ctypes.wintypes.POINT(0, 0) ctypes.windll.user32.GetCursorPos(ctypes.byref(point)) return point.x, point.y
[ "GetCursorPos", "from", "Win32", ".", "Get", "current", "mouse", "cursor", "positon", ".", "Return", "tuple", "two", "ints", "tuple", "(", "x", "y", ")", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1780-L1788
[ "def", "GetCursorPos", "(", ")", "->", "tuple", ":", "point", "=", "ctypes", ".", "wintypes", ".", "POINT", "(", "0", ",", "0", ")", "ctypes", ".", "windll", ".", "user32", ".", "GetCursorPos", "(", "ctypes", ".", "byref", "(", "point", ")", ")", "...
2cc91060982cc8b777152e698d677cc2989bf263
valid
SetCursorPos
SetCursorPos from Win32. Set mouse cursor to point x, y. x: int. y: int. Return bool, True if succeed otherwise False.
uiautomation/uiautomation.py
def SetCursorPos(x: int, y: int) -> bool: """ SetCursorPos from Win32. Set mouse cursor to point x, y. x: int. y: int. Return bool, True if succeed otherwise False. """ return bool(ctypes.windll.user32.SetCursorPos(x, y))
def SetCursorPos(x: int, y: int) -> bool: """ SetCursorPos from Win32. Set mouse cursor to point x, y. x: int. y: int. Return bool, True if succeed otherwise False. """ return bool(ctypes.windll.user32.SetCursorPos(x, y))
[ "SetCursorPos", "from", "Win32", ".", "Set", "mouse", "cursor", "to", "point", "x", "y", ".", "x", ":", "int", ".", "y", ":", "int", ".", "Return", "bool", "True", "if", "succeed", "otherwise", "False", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1791-L1799
[ "def", "SetCursorPos", "(", "x", ":", "int", ",", "y", ":", "int", ")", "->", "bool", ":", "return", "bool", "(", "ctypes", ".", "windll", ".", "user32", ".", "SetCursorPos", "(", "x", ",", "y", ")", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
mouse_event
mouse_event from Win32.
uiautomation/uiautomation.py
def mouse_event(dwFlags: int, dx: int, dy: int, dwData: int, dwExtraInfo: int) -> None: """mouse_event from Win32.""" ctypes.windll.user32.mouse_event(dwFlags, dx, dy, dwData, dwExtraInfo)
def mouse_event(dwFlags: int, dx: int, dy: int, dwData: int, dwExtraInfo: int) -> None: """mouse_event from Win32.""" ctypes.windll.user32.mouse_event(dwFlags, dx, dy, dwData, dwExtraInfo)
[ "mouse_event", "from", "Win32", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1810-L1812
[ "def", "mouse_event", "(", "dwFlags", ":", "int", ",", "dx", ":", "int", ",", "dy", ":", "int", ",", "dwData", ":", "int", ",", "dwExtraInfo", ":", "int", ")", "->", "None", ":", "ctypes", ".", "windll", ".", "user32", ".", "mouse_event", "(", "dwF...
2cc91060982cc8b777152e698d677cc2989bf263
valid
keybd_event
keybd_event from Win32.
uiautomation/uiautomation.py
def keybd_event(bVk: int, bScan: int, dwFlags: int, dwExtraInfo: int) -> None: """keybd_event from Win32.""" ctypes.windll.user32.keybd_event(bVk, bScan, dwFlags, dwExtraInfo)
def keybd_event(bVk: int, bScan: int, dwFlags: int, dwExtraInfo: int) -> None: """keybd_event from Win32.""" ctypes.windll.user32.keybd_event(bVk, bScan, dwFlags, dwExtraInfo)
[ "keybd_event", "from", "Win32", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1815-L1817
[ "def", "keybd_event", "(", "bVk", ":", "int", ",", "bScan", ":", "int", ",", "dwFlags", ":", "int", ",", "dwExtraInfo", ":", "int", ")", "->", "None", ":", "ctypes", ".", "windll", ".", "user32", ".", "keybd_event", "(", "bVk", ",", "bScan", ",", "...
2cc91060982cc8b777152e698d677cc2989bf263
valid
PostMessage
PostMessage from Win32. Return bool, True if succeed otherwise False.
uiautomation/uiautomation.py
def PostMessage(handle: int, msg: int, wParam: int, lParam: int) -> bool: """ PostMessage from Win32. Return bool, True if succeed otherwise False. """ return bool(ctypes.windll.user32.PostMessageW(ctypes.c_void_p(handle), msg, wParam, lParam))
def PostMessage(handle: int, msg: int, wParam: int, lParam: int) -> bool: """ PostMessage from Win32. Return bool, True if succeed otherwise False. """ return bool(ctypes.windll.user32.PostMessageW(ctypes.c_void_p(handle), msg, wParam, lParam))
[ "PostMessage", "from", "Win32", ".", "Return", "bool", "True", "if", "succeed", "otherwise", "False", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1820-L1825
[ "def", "PostMessage", "(", "handle", ":", "int", ",", "msg", ":", "int", ",", "wParam", ":", "int", ",", "lParam", ":", "int", ")", "->", "bool", ":", "return", "bool", "(", "ctypes", ".", "windll", ".", "user32", ".", "PostMessageW", "(", "ctypes", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
SendMessage
SendMessage from Win32. Return int, the return value specifies the result of the message processing; it depends on the message sent.
uiautomation/uiautomation.py
def SendMessage(handle: int, msg: int, wParam: int, lParam: int) -> int: """ SendMessage from Win32. Return int, the return value specifies the result of the message processing; it depends on the message sent. """ return ctypes.windll.user32.SendMessageW(ctypes.c_void_p(handle), msg,...
def SendMessage(handle: int, msg: int, wParam: int, lParam: int) -> int: """ SendMessage from Win32. Return int, the return value specifies the result of the message processing; it depends on the message sent. """ return ctypes.windll.user32.SendMessageW(ctypes.c_void_p(handle), msg,...
[ "SendMessage", "from", "Win32", ".", "Return", "int", "the", "return", "value", "specifies", "the", "result", "of", "the", "message", "processing", ";", "it", "depends", "on", "the", "message", "sent", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1828-L1834
[ "def", "SendMessage", "(", "handle", ":", "int", ",", "msg", ":", "int", ",", "wParam", ":", "int", ",", "lParam", ":", "int", ")", "->", "int", ":", "return", "ctypes", ".", "windll", ".", "user32", ".", "SendMessageW", "(", "ctypes", ".", "c_void_p...
2cc91060982cc8b777152e698d677cc2989bf263
valid
Click
Simulate mouse click at point x, y. x: int. y: int. waitTime: float.
uiautomation/uiautomation.py
def Click(x: int, y: int, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate mouse click at point x, y. x: int. y: int. waitTime: float. """ SetCursorPos(x, y) screenWidth, screenHeight = GetScreenSize() mouse_event(MouseEventFlag.LeftDown | MouseEventFlag.Absolute, x * 655...
def Click(x: int, y: int, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate mouse click at point x, y. x: int. y: int. waitTime: float. """ SetCursorPos(x, y) screenWidth, screenHeight = GetScreenSize() mouse_event(MouseEventFlag.LeftDown | MouseEventFlag.Absolute, x * 655...
[ "Simulate", "mouse", "click", "at", "point", "x", "y", ".", "x", ":", "int", ".", "y", ":", "int", ".", "waitTime", ":", "float", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1837-L1849
[ "def", "Click", "(", "x", ":", "int", ",", "y", ":", "int", ",", "waitTime", ":", "float", "=", "OPERATION_WAIT_TIME", ")", "->", "None", ":", "SetCursorPos", "(", "x", ",", "y", ")", "screenWidth", ",", "screenHeight", "=", "GetScreenSize", "(", ")", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
MiddleClick
Simulate mouse middle click at point x, y. x: int. y: int. waitTime: float.
uiautomation/uiautomation.py
def MiddleClick(x: int, y: int, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate mouse middle click at point x, y. x: int. y: int. waitTime: float. """ SetCursorPos(x, y) screenWidth, screenHeight = GetScreenSize() mouse_event(MouseEventFlag.MiddleDown | MouseEventFlag.Ab...
def MiddleClick(x: int, y: int, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate mouse middle click at point x, y. x: int. y: int. waitTime: float. """ SetCursorPos(x, y) screenWidth, screenHeight = GetScreenSize() mouse_event(MouseEventFlag.MiddleDown | MouseEventFlag.Ab...
[ "Simulate", "mouse", "middle", "click", "at", "point", "x", "y", ".", "x", ":", "int", ".", "y", ":", "int", ".", "waitTime", ":", "float", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1852-L1864
[ "def", "MiddleClick", "(", "x", ":", "int", ",", "y", ":", "int", ",", "waitTime", ":", "float", "=", "OPERATION_WAIT_TIME", ")", "->", "None", ":", "SetCursorPos", "(", "x", ",", "y", ")", "screenWidth", ",", "screenHeight", "=", "GetScreenSize", "(", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
RightClick
Simulate mouse right click at point x, y. x: int. y: int. waitTime: float.
uiautomation/uiautomation.py
def RightClick(x: int, y: int, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate mouse right click at point x, y. x: int. y: int. waitTime: float. """ SetCursorPos(x, y) screenWidth, screenHeight = GetScreenSize() mouse_event(MouseEventFlag.RightDown | MouseEventFlag.Absol...
def RightClick(x: int, y: int, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate mouse right click at point x, y. x: int. y: int. waitTime: float. """ SetCursorPos(x, y) screenWidth, screenHeight = GetScreenSize() mouse_event(MouseEventFlag.RightDown | MouseEventFlag.Absol...
[ "Simulate", "mouse", "right", "click", "at", "point", "x", "y", ".", "x", ":", "int", ".", "y", ":", "int", ".", "waitTime", ":", "float", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1867-L1879
[ "def", "RightClick", "(", "x", ":", "int", ",", "y", ":", "int", ",", "waitTime", ":", "float", "=", "OPERATION_WAIT_TIME", ")", "->", "None", ":", "SetCursorPos", "(", "x", ",", "y", ")", "screenWidth", ",", "screenHeight", "=", "GetScreenSize", "(", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
PressMouse
Press left mouse. x: int. y: int. waitTime: float.
uiautomation/uiautomation.py
def PressMouse(x: int, y: int, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Press left mouse. x: int. y: int. waitTime: float. """ SetCursorPos(x, y) screenWidth, screenHeight = GetScreenSize() mouse_event(MouseEventFlag.LeftDown | MouseEventFlag.Absolute, x * 65535 // screenW...
def PressMouse(x: int, y: int, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Press left mouse. x: int. y: int. waitTime: float. """ SetCursorPos(x, y) screenWidth, screenHeight = GetScreenSize() mouse_event(MouseEventFlag.LeftDown | MouseEventFlag.Absolute, x * 65535 // screenW...
[ "Press", "left", "mouse", ".", "x", ":", "int", ".", "y", ":", "int", ".", "waitTime", ":", "float", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1882-L1892
[ "def", "PressMouse", "(", "x", ":", "int", ",", "y", ":", "int", ",", "waitTime", ":", "float", "=", "OPERATION_WAIT_TIME", ")", "->", "None", ":", "SetCursorPos", "(", "x", ",", "y", ")", "screenWidth", ",", "screenHeight", "=", "GetScreenSize", "(", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
ReleaseMouse
Release left mouse. waitTime: float.
uiautomation/uiautomation.py
def ReleaseMouse(waitTime: float = OPERATION_WAIT_TIME) -> None: """ Release left mouse. waitTime: float. """ x, y = GetCursorPos() screenWidth, screenHeight = GetScreenSize() mouse_event(MouseEventFlag.LeftUp | MouseEventFlag.Absolute, x * 65535 // screenWidth, y * 65535 // screenHeight, 0,...
def ReleaseMouse(waitTime: float = OPERATION_WAIT_TIME) -> None: """ Release left mouse. waitTime: float. """ x, y = GetCursorPos() screenWidth, screenHeight = GetScreenSize() mouse_event(MouseEventFlag.LeftUp | MouseEventFlag.Absolute, x * 65535 // screenWidth, y * 65535 // screenHeight, 0,...
[ "Release", "left", "mouse", ".", "waitTime", ":", "float", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1895-L1903
[ "def", "ReleaseMouse", "(", "waitTime", ":", "float", "=", "OPERATION_WAIT_TIME", ")", "->", "None", ":", "x", ",", "y", "=", "GetCursorPos", "(", ")", "screenWidth", ",", "screenHeight", "=", "GetScreenSize", "(", ")", "mouse_event", "(", "MouseEventFlag", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
RightPressMouse
Press right mouse. x: int. y: int. waitTime: float.
uiautomation/uiautomation.py
def RightPressMouse(x: int, y: int, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Press right mouse. x: int. y: int. waitTime: float. """ SetCursorPos(x, y) screenWidth, screenHeight = GetScreenSize() mouse_event(MouseEventFlag.RightDown | MouseEventFlag.Absolute, x * 65535 // ...
def RightPressMouse(x: int, y: int, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Press right mouse. x: int. y: int. waitTime: float. """ SetCursorPos(x, y) screenWidth, screenHeight = GetScreenSize() mouse_event(MouseEventFlag.RightDown | MouseEventFlag.Absolute, x * 65535 // ...
[ "Press", "right", "mouse", ".", "x", ":", "int", ".", "y", ":", "int", ".", "waitTime", ":", "float", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1906-L1916
[ "def", "RightPressMouse", "(", "x", ":", "int", ",", "y", ":", "int", ",", "waitTime", ":", "float", "=", "OPERATION_WAIT_TIME", ")", "->", "None", ":", "SetCursorPos", "(", "x", ",", "y", ")", "screenWidth", ",", "screenHeight", "=", "GetScreenSize", "(...
2cc91060982cc8b777152e698d677cc2989bf263
valid
RightReleaseMouse
Release right mouse. waitTime: float.
uiautomation/uiautomation.py
def RightReleaseMouse(waitTime: float = OPERATION_WAIT_TIME) -> None: """ Release right mouse. waitTime: float. """ x, y = GetCursorPos() screenWidth, screenHeight = GetScreenSize() mouse_event(MouseEventFlag.RightUp | MouseEventFlag.Absolute, x * 65535 // screenWidth, y * 65535 // screenHei...
def RightReleaseMouse(waitTime: float = OPERATION_WAIT_TIME) -> None: """ Release right mouse. waitTime: float. """ x, y = GetCursorPos() screenWidth, screenHeight = GetScreenSize() mouse_event(MouseEventFlag.RightUp | MouseEventFlag.Absolute, x * 65535 // screenWidth, y * 65535 // screenHei...
[ "Release", "right", "mouse", ".", "waitTime", ":", "float", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1919-L1927
[ "def", "RightReleaseMouse", "(", "waitTime", ":", "float", "=", "OPERATION_WAIT_TIME", ")", "->", "None", ":", "x", ",", "y", "=", "GetCursorPos", "(", ")", "screenWidth", ",", "screenHeight", "=", "GetScreenSize", "(", ")", "mouse_event", "(", "MouseEventFlag...
2cc91060982cc8b777152e698d677cc2989bf263
valid
MoveTo
Simulate mouse move to point x, y from current cursor. x: int. y: int. moveSpeed: float, 1 normal speed, < 1 move slower, > 1 move faster. waitTime: float.
uiautomation/uiautomation.py
def MoveTo(x: int, y: int, moveSpeed: float = 1, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate mouse move to point x, y from current cursor. x: int. y: int. moveSpeed: float, 1 normal speed, < 1 move slower, > 1 move faster. waitTime: float. """ if moveSpeed <= 0: ...
def MoveTo(x: int, y: int, moveSpeed: float = 1, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate mouse move to point x, y from current cursor. x: int. y: int. moveSpeed: float, 1 normal speed, < 1 move slower, > 1 move faster. waitTime: float. """ if moveSpeed <= 0: ...
[ "Simulate", "mouse", "move", "to", "point", "x", "y", "from", "current", "cursor", ".", "x", ":", "int", ".", "y", ":", "int", ".", "moveSpeed", ":", "float", "1", "normal", "speed", "<", "1", "move", "slower", ">", "1", "move", "faster", ".", "wai...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1930-L1967
[ "def", "MoveTo", "(", "x", ":", "int", ",", "y", ":", "int", ",", "moveSpeed", ":", "float", "=", "1", ",", "waitTime", ":", "float", "=", "OPERATION_WAIT_TIME", ")", "->", "None", ":", "if", "moveSpeed", "<=", "0", ":", "moveTime", "=", "0", "else...
2cc91060982cc8b777152e698d677cc2989bf263
valid
DragDrop
Simulate mouse left button drag from point x1, y1 drop to point x2, y2. x1: int. y1: int. x2: int. y2: int. moveSpeed: float, 1 normal speed, < 1 move slower, > 1 move faster. waitTime: float.
uiautomation/uiautomation.py
def DragDrop(x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate mouse left button drag from point x1, y1 drop to point x2, y2. x1: int. y1: int. x2: int. y2: int. moveSpeed: float, 1 normal speed, < 1 move slower, > 1 move f...
def DragDrop(x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate mouse left button drag from point x1, y1 drop to point x2, y2. x1: int. y1: int. x2: int. y2: int. moveSpeed: float, 1 normal speed, < 1 move slower, > 1 move f...
[ "Simulate", "mouse", "left", "button", "drag", "from", "point", "x1", "y1", "drop", "to", "point", "x2", "y2", ".", "x1", ":", "int", ".", "y1", ":", "int", ".", "x2", ":", "int", ".", "y2", ":", "int", ".", "moveSpeed", ":", "float", "1", "norma...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1970-L1982
[ "def", "DragDrop", "(", "x1", ":", "int", ",", "y1", ":", "int", ",", "x2", ":", "int", ",", "y2", ":", "int", ",", "moveSpeed", ":", "float", "=", "1", ",", "waitTime", ":", "float", "=", "OPERATION_WAIT_TIME", ")", "->", "None", ":", "PressMouse"...
2cc91060982cc8b777152e698d677cc2989bf263
valid
RightDragDrop
Simulate mouse right button drag from point x1, y1 drop to point x2, y2. x1: int. y1: int. x2: int. y2: int. moveSpeed: float, 1 normal speed, < 1 move slower, > 1 move faster. waitTime: float.
uiautomation/uiautomation.py
def RightDragDrop(x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate mouse right button drag from point x1, y1 drop to point x2, y2. x1: int. y1: int. x2: int. y2: int. moveSpeed: float, 1 normal speed, < 1 move slower, > 1 ...
def RightDragDrop(x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate mouse right button drag from point x1, y1 drop to point x2, y2. x1: int. y1: int. x2: int. y2: int. moveSpeed: float, 1 normal speed, < 1 move slower, > 1 ...
[ "Simulate", "mouse", "right", "button", "drag", "from", "point", "x1", "y1", "drop", "to", "point", "x2", "y2", ".", "x1", ":", "int", ".", "y1", ":", "int", ".", "x2", ":", "int", ".", "y2", ":", "int", ".", "moveSpeed", ":", "float", "1", "norm...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L1985-L1997
[ "def", "RightDragDrop", "(", "x1", ":", "int", ",", "y1", ":", "int", ",", "x2", ":", "int", ",", "y2", ":", "int", ",", "moveSpeed", ":", "float", "=", "1", ",", "waitTime", ":", "float", "=", "OPERATION_WAIT_TIME", ")", "->", "None", ":", "RightP...
2cc91060982cc8b777152e698d677cc2989bf263
valid
WheelUp
Simulate mouse wheel up. wheelTimes: int. interval: float. waitTime: float.
uiautomation/uiautomation.py
def WheelUp(wheelTimes: int = 1, interval: float = 0.05, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate mouse wheel up. wheelTimes: int. interval: float. waitTime: float. """ for i in range(wheelTimes): mouse_event(MouseEventFlag.Wheel, 0, 0, 120, 0) #WHEEL_DELTA=120 ...
def WheelUp(wheelTimes: int = 1, interval: float = 0.05, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate mouse wheel up. wheelTimes: int. interval: float. waitTime: float. """ for i in range(wheelTimes): mouse_event(MouseEventFlag.Wheel, 0, 0, 120, 0) #WHEEL_DELTA=120 ...
[ "Simulate", "mouse", "wheel", "up", ".", "wheelTimes", ":", "int", ".", "interval", ":", "float", ".", "waitTime", ":", "float", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2013-L2023
[ "def", "WheelUp", "(", "wheelTimes", ":", "int", "=", "1", ",", "interval", ":", "float", "=", "0.05", ",", "waitTime", ":", "float", "=", "OPERATION_WAIT_TIME", ")", "->", "None", ":", "for", "i", "in", "range", "(", "wheelTimes", ")", ":", "mouse_eve...
2cc91060982cc8b777152e698d677cc2989bf263
valid
GetScreenSize
Return tuple, two ints tuple (width, height).
uiautomation/uiautomation.py
def GetScreenSize() -> tuple: """Return tuple, two ints tuple (width, height).""" SM_CXSCREEN = 0 SM_CYSCREEN = 1 w = ctypes.windll.user32.GetSystemMetrics(SM_CXSCREEN) h = ctypes.windll.user32.GetSystemMetrics(SM_CYSCREEN) return w, h
def GetScreenSize() -> tuple: """Return tuple, two ints tuple (width, height).""" SM_CXSCREEN = 0 SM_CYSCREEN = 1 w = ctypes.windll.user32.GetSystemMetrics(SM_CXSCREEN) h = ctypes.windll.user32.GetSystemMetrics(SM_CYSCREEN) return w, h
[ "Return", "tuple", "two", "ints", "tuple", "(", "width", "height", ")", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2026-L2032
[ "def", "GetScreenSize", "(", ")", "->", "tuple", ":", "SM_CXSCREEN", "=", "0", "SM_CYSCREEN", "=", "1", "w", "=", "ctypes", ".", "windll", ".", "user32", ".", "GetSystemMetrics", "(", "SM_CXSCREEN", ")", "h", "=", "ctypes", ".", "windll", ".", "user32", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
GetPixelColor
Get pixel color of a native window. x: int. y: int. handle: int, the handle of a native window. Return int, the bgr value of point (x,y). r = bgr & 0x0000FF g = (bgr & 0x00FF00) >> 8 b = (bgr & 0xFF0000) >> 16 If handle is 0, get pixel from Desktop window(root control). Note: Not...
uiautomation/uiautomation.py
def GetPixelColor(x: int, y: int, handle: int = 0) -> int: """ Get pixel color of a native window. x: int. y: int. handle: int, the handle of a native window. Return int, the bgr value of point (x,y). r = bgr & 0x0000FF g = (bgr & 0x00FF00) >> 8 b = (bgr & 0xFF0000) >> 16 If hand...
def GetPixelColor(x: int, y: int, handle: int = 0) -> int: """ Get pixel color of a native window. x: int. y: int. handle: int, the handle of a native window. Return int, the bgr value of point (x,y). r = bgr & 0x0000FF g = (bgr & 0x00FF00) >> 8 b = (bgr & 0xFF0000) >> 16 If hand...
[ "Get", "pixel", "color", "of", "a", "native", "window", ".", "x", ":", "int", ".", "y", ":", "int", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "Return", "int", "the", "bgr", "value", "of", "point", "(", "x", "...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2035-L2054
[ "def", "GetPixelColor", "(", "x", ":", "int", ",", "y", ":", "int", ",", "handle", ":", "int", "=", "0", ")", "->", "int", ":", "hdc", "=", "ctypes", ".", "windll", ".", "user32", ".", "GetWindowDC", "(", "ctypes", ".", "c_void_p", "(", "handle", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
MessageBox
MessageBox from Win32. content: str. title: str. flags: int, a value or some combined values in class `MB`. Return int, a value in MB whose name starts with Id, such as MB.IdOk
uiautomation/uiautomation.py
def MessageBox(content: str, title: str, flags: int = MB.Ok) -> int: """ MessageBox from Win32. content: str. title: str. flags: int, a value or some combined values in class `MB`. Return int, a value in MB whose name starts with Id, such as MB.IdOk """ return ctypes.windll.user32.Messag...
def MessageBox(content: str, title: str, flags: int = MB.Ok) -> int: """ MessageBox from Win32. content: str. title: str. flags: int, a value or some combined values in class `MB`. Return int, a value in MB whose name starts with Id, such as MB.IdOk """ return ctypes.windll.user32.Messag...
[ "MessageBox", "from", "Win32", ".", "content", ":", "str", ".", "title", ":", "str", ".", "flags", ":", "int", "a", "value", "or", "some", "combined", "values", "in", "class", "MB", ".", "Return", "int", "a", "value", "in", "MB", "whose", "name", "st...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2057-L2065
[ "def", "MessageBox", "(", "content", ":", "str", ",", "title", ":", "str", ",", "flags", ":", "int", "=", "MB", ".", "Ok", ")", "->", "int", ":", "return", "ctypes", ".", "windll", ".", "user32", ".", "MessageBoxW", "(", "ctypes", ".", "c_void_p", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
SetForegroundWindow
SetForegroundWindow from Win32. handle: int, the handle of a native window. Return bool, True if succeed otherwise False.
uiautomation/uiautomation.py
def SetForegroundWindow(handle: int) -> bool: """ SetForegroundWindow from Win32. handle: int, the handle of a native window. Return bool, True if succeed otherwise False. """ return bool(ctypes.windll.user32.SetForegroundWindow(ctypes.c_void_p(handle)))
def SetForegroundWindow(handle: int) -> bool: """ SetForegroundWindow from Win32. handle: int, the handle of a native window. Return bool, True if succeed otherwise False. """ return bool(ctypes.windll.user32.SetForegroundWindow(ctypes.c_void_p(handle)))
[ "SetForegroundWindow", "from", "Win32", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "Return", "bool", "True", "if", "succeed", "otherwise", "False", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2068-L2074
[ "def", "SetForegroundWindow", "(", "handle", ":", "int", ")", "->", "bool", ":", "return", "bool", "(", "ctypes", ".", "windll", ".", "user32", ".", "SetForegroundWindow", "(", "ctypes", ".", "c_void_p", "(", "handle", ")", ")", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
BringWindowToTop
BringWindowToTop from Win32. handle: int, the handle of a native window. Return bool, True if succeed otherwise False.
uiautomation/uiautomation.py
def BringWindowToTop(handle: int) -> bool: """ BringWindowToTop from Win32. handle: int, the handle of a native window. Return bool, True if succeed otherwise False. """ return bool(ctypes.windll.user32.BringWindowToTop(ctypes.c_void_p(handle)))
def BringWindowToTop(handle: int) -> bool: """ BringWindowToTop from Win32. handle: int, the handle of a native window. Return bool, True if succeed otherwise False. """ return bool(ctypes.windll.user32.BringWindowToTop(ctypes.c_void_p(handle)))
[ "BringWindowToTop", "from", "Win32", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "Return", "bool", "True", "if", "succeed", "otherwise", "False", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2077-L2083
[ "def", "BringWindowToTop", "(", "handle", ":", "int", ")", "->", "bool", ":", "return", "bool", "(", "ctypes", ".", "windll", ".", "user32", ".", "BringWindowToTop", "(", "ctypes", ".", "c_void_p", "(", "handle", ")", ")", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
SwitchToThisWindow
SwitchToThisWindow from Win32. handle: int, the handle of a native window.
uiautomation/uiautomation.py
def SwitchToThisWindow(handle: int) -> None: """ SwitchToThisWindow from Win32. handle: int, the handle of a native window. """ ctypes.windll.user32.SwitchToThisWindow(ctypes.c_void_p(handle), 1)
def SwitchToThisWindow(handle: int) -> None: """ SwitchToThisWindow from Win32. handle: int, the handle of a native window. """ ctypes.windll.user32.SwitchToThisWindow(ctypes.c_void_p(handle), 1)
[ "SwitchToThisWindow", "from", "Win32", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2086-L2091
[ "def", "SwitchToThisWindow", "(", "handle", ":", "int", ")", "->", "None", ":", "ctypes", ".", "windll", ".", "user32", ".", "SwitchToThisWindow", "(", "ctypes", ".", "c_void_p", "(", "handle", ")", ",", "1", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
GetAncestor
GetAncestor from Win32. handle: int, the handle of a native window. index: int, a value in class `GAFlag`. Return int, a native window handle.
uiautomation/uiautomation.py
def GetAncestor(handle: int, flag: int) -> int: """ GetAncestor from Win32. handle: int, the handle of a native window. index: int, a value in class `GAFlag`. Return int, a native window handle. """ return ctypes.windll.user32.GetAncestor(ctypes.c_void_p(handle), flag)
def GetAncestor(handle: int, flag: int) -> int: """ GetAncestor from Win32. handle: int, the handle of a native window. index: int, a value in class `GAFlag`. Return int, a native window handle. """ return ctypes.windll.user32.GetAncestor(ctypes.c_void_p(handle), flag)
[ "GetAncestor", "from", "Win32", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "index", ":", "int", "a", "value", "in", "class", "GAFlag", ".", "Return", "int", "a", "native", "window", "handle", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2094-L2101
[ "def", "GetAncestor", "(", "handle", ":", "int", ",", "flag", ":", "int", ")", "->", "int", ":", "return", "ctypes", ".", "windll", ".", "user32", ".", "GetAncestor", "(", "ctypes", ".", "c_void_p", "(", "handle", ")", ",", "flag", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
IsTopLevelWindow
IsTopLevelWindow from Win32. handle: int, the handle of a native window. Return bool. Only available on Windows 7 or Higher.
uiautomation/uiautomation.py
def IsTopLevelWindow(handle: int) -> bool: """ IsTopLevelWindow from Win32. handle: int, the handle of a native window. Return bool. Only available on Windows 7 or Higher. """ return bool(ctypes.windll.user32.IsTopLevelWindow(ctypes.c_void_p(handle)))
def IsTopLevelWindow(handle: int) -> bool: """ IsTopLevelWindow from Win32. handle: int, the handle of a native window. Return bool. Only available on Windows 7 or Higher. """ return bool(ctypes.windll.user32.IsTopLevelWindow(ctypes.c_void_p(handle)))
[ "IsTopLevelWindow", "from", "Win32", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "Return", "bool", ".", "Only", "available", "on", "Windows", "7", "or", "Higher", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2104-L2111
[ "def", "IsTopLevelWindow", "(", "handle", ":", "int", ")", "->", "bool", ":", "return", "bool", "(", "ctypes", ".", "windll", ".", "user32", ".", "IsTopLevelWindow", "(", "ctypes", ".", "c_void_p", "(", "handle", ")", ")", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
GetWindowLong
GetWindowLong from Win32. handle: int, the handle of a native window. index: int.
uiautomation/uiautomation.py
def GetWindowLong(handle: int, index: int) -> int: """ GetWindowLong from Win32. handle: int, the handle of a native window. index: int. """ return ctypes.windll.user32.GetWindowLongW(ctypes.c_void_p(handle), index)
def GetWindowLong(handle: int, index: int) -> int: """ GetWindowLong from Win32. handle: int, the handle of a native window. index: int. """ return ctypes.windll.user32.GetWindowLongW(ctypes.c_void_p(handle), index)
[ "GetWindowLong", "from", "Win32", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "index", ":", "int", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2114-L2120
[ "def", "GetWindowLong", "(", "handle", ":", "int", ",", "index", ":", "int", ")", "->", "int", ":", "return", "ctypes", ".", "windll", ".", "user32", ".", "GetWindowLongW", "(", "ctypes", ".", "c_void_p", "(", "handle", ")", ",", "index", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
SetWindowLong
SetWindowLong from Win32. handle: int, the handle of a native window. index: int. value: int. Return int, the previous value before set.
uiautomation/uiautomation.py
def SetWindowLong(handle: int, index: int, value: int) -> int: """ SetWindowLong from Win32. handle: int, the handle of a native window. index: int. value: int. Return int, the previous value before set. """ return ctypes.windll.user32.SetWindowLongW(ctypes.c_void_p(handle), index, value...
def SetWindowLong(handle: int, index: int, value: int) -> int: """ SetWindowLong from Win32. handle: int, the handle of a native window. index: int. value: int. Return int, the previous value before set. """ return ctypes.windll.user32.SetWindowLongW(ctypes.c_void_p(handle), index, value...
[ "SetWindowLong", "from", "Win32", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "index", ":", "int", ".", "value", ":", "int", ".", "Return", "int", "the", "previous", "value", "before", "set", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2123-L2131
[ "def", "SetWindowLong", "(", "handle", ":", "int", ",", "index", ":", "int", ",", "value", ":", "int", ")", "->", "int", ":", "return", "ctypes", ".", "windll", ".", "user32", ".", "SetWindowLongW", "(", "ctypes", ".", "c_void_p", "(", "handle", ")", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
IsIconic
IsIconic from Win32. Determine whether a native window is minimized. handle: int, the handle of a native window. Return bool.
uiautomation/uiautomation.py
def IsIconic(handle: int) -> bool: """ IsIconic from Win32. Determine whether a native window is minimized. handle: int, the handle of a native window. Return bool. """ return bool(ctypes.windll.user32.IsIconic(ctypes.c_void_p(handle)))
def IsIconic(handle: int) -> bool: """ IsIconic from Win32. Determine whether a native window is minimized. handle: int, the handle of a native window. Return bool. """ return bool(ctypes.windll.user32.IsIconic(ctypes.c_void_p(handle)))
[ "IsIconic", "from", "Win32", ".", "Determine", "whether", "a", "native", "window", "is", "minimized", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "Return", "bool", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2134-L2141
[ "def", "IsIconic", "(", "handle", ":", "int", ")", "->", "bool", ":", "return", "bool", "(", "ctypes", ".", "windll", ".", "user32", ".", "IsIconic", "(", "ctypes", ".", "c_void_p", "(", "handle", ")", ")", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
IsZoomed
IsZoomed from Win32. Determine whether a native window is maximized. handle: int, the handle of a native window. Return bool.
uiautomation/uiautomation.py
def IsZoomed(handle: int) -> bool: """ IsZoomed from Win32. Determine whether a native window is maximized. handle: int, the handle of a native window. Return bool. """ return bool(ctypes.windll.user32.IsZoomed(ctypes.c_void_p(handle)))
def IsZoomed(handle: int) -> bool: """ IsZoomed from Win32. Determine whether a native window is maximized. handle: int, the handle of a native window. Return bool. """ return bool(ctypes.windll.user32.IsZoomed(ctypes.c_void_p(handle)))
[ "IsZoomed", "from", "Win32", ".", "Determine", "whether", "a", "native", "window", "is", "maximized", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "Return", "bool", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2144-L2151
[ "def", "IsZoomed", "(", "handle", ":", "int", ")", "->", "bool", ":", "return", "bool", "(", "ctypes", ".", "windll", ".", "user32", ".", "IsZoomed", "(", "ctypes", ".", "c_void_p", "(", "handle", ")", ")", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
IsWindowVisible
IsWindowVisible from Win32. handle: int, the handle of a native window. Return bool.
uiautomation/uiautomation.py
def IsWindowVisible(handle: int) -> bool: """ IsWindowVisible from Win32. handle: int, the handle of a native window. Return bool. """ return bool(ctypes.windll.user32.IsWindowVisible(ctypes.c_void_p(handle)))
def IsWindowVisible(handle: int) -> bool: """ IsWindowVisible from Win32. handle: int, the handle of a native window. Return bool. """ return bool(ctypes.windll.user32.IsWindowVisible(ctypes.c_void_p(handle)))
[ "IsWindowVisible", "from", "Win32", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "Return", "bool", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2154-L2160
[ "def", "IsWindowVisible", "(", "handle", ":", "int", ")", "->", "bool", ":", "return", "bool", "(", "ctypes", ".", "windll", ".", "user32", ".", "IsWindowVisible", "(", "ctypes", ".", "c_void_p", "(", "handle", ")", ")", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
ShowWindow
ShowWindow from Win32. handle: int, the handle of a native window. cmdShow: int, a value in clas `SW`. Return bool, True if succeed otherwise False.
uiautomation/uiautomation.py
def ShowWindow(handle: int, cmdShow: int) -> bool: """ ShowWindow from Win32. handle: int, the handle of a native window. cmdShow: int, a value in clas `SW`. Return bool, True if succeed otherwise False. """ return ctypes.windll.user32.ShowWindow(ctypes.c_void_p(handle), cmdShow)
def ShowWindow(handle: int, cmdShow: int) -> bool: """ ShowWindow from Win32. handle: int, the handle of a native window. cmdShow: int, a value in clas `SW`. Return bool, True if succeed otherwise False. """ return ctypes.windll.user32.ShowWindow(ctypes.c_void_p(handle), cmdShow)
[ "ShowWindow", "from", "Win32", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "cmdShow", ":", "int", "a", "value", "in", "clas", "SW", ".", "Return", "bool", "True", "if", "succeed", "otherwise", "False", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2163-L2170
[ "def", "ShowWindow", "(", "handle", ":", "int", ",", "cmdShow", ":", "int", ")", "->", "bool", ":", "return", "ctypes", ".", "windll", ".", "user32", ".", "ShowWindow", "(", "ctypes", ".", "c_void_p", "(", "handle", ")", ",", "cmdShow", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
MoveWindow
MoveWindow from Win32. handle: int, the handle of a native window. x: int. y: int. width: int. height: int. repaint: int, use 1 or 0. Return bool, True if succeed otherwise False.
uiautomation/uiautomation.py
def MoveWindow(handle: int, x: int, y: int, width: int, height: int, repaint: int = 1) -> bool: """ MoveWindow from Win32. handle: int, the handle of a native window. x: int. y: int. width: int. height: int. repaint: int, use 1 or 0. Return bool, True if succeed otherwise False. ...
def MoveWindow(handle: int, x: int, y: int, width: int, height: int, repaint: int = 1) -> bool: """ MoveWindow from Win32. handle: int, the handle of a native window. x: int. y: int. width: int. height: int. repaint: int, use 1 or 0. Return bool, True if succeed otherwise False. ...
[ "MoveWindow", "from", "Win32", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "x", ":", "int", ".", "y", ":", "int", ".", "width", ":", "int", ".", "height", ":", "int", ".", "repaint", ":", "int", "use", "1", "or...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2173-L2184
[ "def", "MoveWindow", "(", "handle", ":", "int", ",", "x", ":", "int", ",", "y", ":", "int", ",", "width", ":", "int", ",", "height", ":", "int", ",", "repaint", ":", "int", "=", "1", ")", "->", "bool", ":", "return", "bool", "(", "ctypes", ".",...
2cc91060982cc8b777152e698d677cc2989bf263
valid
SetWindowPos
SetWindowPos from Win32. handle: int, the handle of a native window. hWndInsertAfter: int, a value whose name starts with 'HWND' in class SWP. x: int. y: int. width: int. height: int. flags: int, values whose name starts with 'SWP' in class `SWP`. Return bool, True if succeed otherwise F...
uiautomation/uiautomation.py
def SetWindowPos(handle: int, hWndInsertAfter: int, x: int, y: int, width: int, height: int, flags: int) -> bool: """ SetWindowPos from Win32. handle: int, the handle of a native window. hWndInsertAfter: int, a value whose name starts with 'HWND' in class SWP. x: int. y: int. width: int. ...
def SetWindowPos(handle: int, hWndInsertAfter: int, x: int, y: int, width: int, height: int, flags: int) -> bool: """ SetWindowPos from Win32. handle: int, the handle of a native window. hWndInsertAfter: int, a value whose name starts with 'HWND' in class SWP. x: int. y: int. width: int. ...
[ "SetWindowPos", "from", "Win32", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "hWndInsertAfter", ":", "int", "a", "value", "whose", "name", "starts", "with", "HWND", "in", "class", "SWP", ".", "x", ":", "int", ".", "y...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2187-L2199
[ "def", "SetWindowPos", "(", "handle", ":", "int", ",", "hWndInsertAfter", ":", "int", ",", "x", ":", "int", ",", "y", ":", "int", ",", "width", ":", "int", ",", "height", ":", "int", ",", "flags", ":", "int", ")", "->", "bool", ":", "return", "ct...
2cc91060982cc8b777152e698d677cc2989bf263
valid
SetWindowTopmost
handle: int, the handle of a native window. isTopmost: bool Return bool, True if succeed otherwise False.
uiautomation/uiautomation.py
def SetWindowTopmost(handle: int, isTopmost: bool) -> bool: """ handle: int, the handle of a native window. isTopmost: bool Return bool, True if succeed otherwise False. """ topValue = SWP.HWND_Topmost if isTopmost else SWP.HWND_NoTopmost return bool(SetWindowPos(handle, topValue, 0, 0, 0, 0...
def SetWindowTopmost(handle: int, isTopmost: bool) -> bool: """ handle: int, the handle of a native window. isTopmost: bool Return bool, True if succeed otherwise False. """ topValue = SWP.HWND_Topmost if isTopmost else SWP.HWND_NoTopmost return bool(SetWindowPos(handle, topValue, 0, 0, 0, 0...
[ "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "isTopmost", ":", "bool", "Return", "bool", "True", "if", "succeed", "otherwise", "False", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2202-L2209
[ "def", "SetWindowTopmost", "(", "handle", ":", "int", ",", "isTopmost", ":", "bool", ")", "->", "bool", ":", "topValue", "=", "SWP", ".", "HWND_Topmost", "if", "isTopmost", "else", "SWP", ".", "HWND_NoTopmost", "return", "bool", "(", "SetWindowPos", "(", "...
2cc91060982cc8b777152e698d677cc2989bf263
valid
GetWindowText
GetWindowText from Win32. handle: int, the handle of a native window. Return str.
uiautomation/uiautomation.py
def GetWindowText(handle: int) -> str: """ GetWindowText from Win32. handle: int, the handle of a native window. Return str. """ arrayType = ctypes.c_wchar * MAX_PATH values = arrayType() ctypes.windll.user32.GetWindowTextW(ctypes.c_void_p(handle), values, MAX_PATH) return values.val...
def GetWindowText(handle: int) -> str: """ GetWindowText from Win32. handle: int, the handle of a native window. Return str. """ arrayType = ctypes.c_wchar * MAX_PATH values = arrayType() ctypes.windll.user32.GetWindowTextW(ctypes.c_void_p(handle), values, MAX_PATH) return values.val...
[ "GetWindowText", "from", "Win32", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "Return", "str", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2212-L2221
[ "def", "GetWindowText", "(", "handle", ":", "int", ")", "->", "str", ":", "arrayType", "=", "ctypes", ".", "c_wchar", "*", "MAX_PATH", "values", "=", "arrayType", "(", ")", "ctypes", ".", "windll", ".", "user32", ".", "GetWindowTextW", "(", "ctypes", "."...
2cc91060982cc8b777152e698d677cc2989bf263
valid
SetWindowText
SetWindowText from Win32. handle: int, the handle of a native window. text: str. Return bool, True if succeed otherwise False.
uiautomation/uiautomation.py
def SetWindowText(handle: int, text: str) -> bool: """ SetWindowText from Win32. handle: int, the handle of a native window. text: str. Return bool, True if succeed otherwise False. """ return bool(ctypes.windll.user32.SetWindowTextW(ctypes.c_void_p(handle), ctypes.c_wchar_p(text)))
def SetWindowText(handle: int, text: str) -> bool: """ SetWindowText from Win32. handle: int, the handle of a native window. text: str. Return bool, True if succeed otherwise False. """ return bool(ctypes.windll.user32.SetWindowTextW(ctypes.c_void_p(handle), ctypes.c_wchar_p(text)))
[ "SetWindowText", "from", "Win32", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "text", ":", "str", ".", "Return", "bool", "True", "if", "succeed", "otherwise", "False", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2224-L2231
[ "def", "SetWindowText", "(", "handle", ":", "int", ",", "text", ":", "str", ")", "->", "bool", ":", "return", "bool", "(", "ctypes", ".", "windll", ".", "user32", ".", "SetWindowTextW", "(", "ctypes", ".", "c_void_p", "(", "handle", ")", ",", "ctypes",...
2cc91060982cc8b777152e698d677cc2989bf263
valid
GetEditText
Get text of a native Win32 Edit. handle: int, the handle of a native window. Return str.
uiautomation/uiautomation.py
def GetEditText(handle: int) -> str: """ Get text of a native Win32 Edit. handle: int, the handle of a native window. Return str. """ textLen = SendMessage(handle, 0x000E, 0, 0) + 1 #WM_GETTEXTLENGTH arrayType = ctypes.c_wchar * textLen values = arrayType() SendMessage(handle, 0x000...
def GetEditText(handle: int) -> str: """ Get text of a native Win32 Edit. handle: int, the handle of a native window. Return str. """ textLen = SendMessage(handle, 0x000E, 0, 0) + 1 #WM_GETTEXTLENGTH arrayType = ctypes.c_wchar * textLen values = arrayType() SendMessage(handle, 0x000...
[ "Get", "text", "of", "a", "native", "Win32", "Edit", ".", "handle", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "Return", "str", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2234-L2244
[ "def", "GetEditText", "(", "handle", ":", "int", ")", "->", "str", ":", "textLen", "=", "SendMessage", "(", "handle", ",", "0x000E", ",", "0", ",", "0", ")", "+", "1", "#WM_GETTEXTLENGTH", "arrayType", "=", "ctypes", ".", "c_wchar", "*", "textLen", "va...
2cc91060982cc8b777152e698d677cc2989bf263
valid
GetConsoleOriginalTitle
GetConsoleOriginalTitle from Win32. Return str. Only available on Windows Vista or higher.
uiautomation/uiautomation.py
def GetConsoleOriginalTitle() -> str: """ GetConsoleOriginalTitle from Win32. Return str. Only available on Windows Vista or higher. """ if IsNT6orHigher: arrayType = ctypes.c_wchar * MAX_PATH values = arrayType() ctypes.windll.kernel32.GetConsoleOriginalTitleW(values, MA...
def GetConsoleOriginalTitle() -> str: """ GetConsoleOriginalTitle from Win32. Return str. Only available on Windows Vista or higher. """ if IsNT6orHigher: arrayType = ctypes.c_wchar * MAX_PATH values = arrayType() ctypes.windll.kernel32.GetConsoleOriginalTitleW(values, MA...
[ "GetConsoleOriginalTitle", "from", "Win32", ".", "Return", "str", ".", "Only", "available", "on", "Windows", "Vista", "or", "higher", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2247-L2259
[ "def", "GetConsoleOriginalTitle", "(", ")", "->", "str", ":", "if", "IsNT6orHigher", ":", "arrayType", "=", "ctypes", ".", "c_wchar", "*", "MAX_PATH", "values", "=", "arrayType", "(", ")", "ctypes", ".", "windll", ".", "kernel32", ".", "GetConsoleOriginalTitle...
2cc91060982cc8b777152e698d677cc2989bf263
valid
GetConsoleTitle
GetConsoleTitle from Win32. Return str.
uiautomation/uiautomation.py
def GetConsoleTitle() -> str: """ GetConsoleTitle from Win32. Return str. """ arrayType = ctypes.c_wchar * MAX_PATH values = arrayType() ctypes.windll.kernel32.GetConsoleTitleW(values, MAX_PATH) return values.value
def GetConsoleTitle() -> str: """ GetConsoleTitle from Win32. Return str. """ arrayType = ctypes.c_wchar * MAX_PATH values = arrayType() ctypes.windll.kernel32.GetConsoleTitleW(values, MAX_PATH) return values.value
[ "GetConsoleTitle", "from", "Win32", ".", "Return", "str", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2262-L2270
[ "def", "GetConsoleTitle", "(", ")", "->", "str", ":", "arrayType", "=", "ctypes", ".", "c_wchar", "*", "MAX_PATH", "values", "=", "arrayType", "(", ")", "ctypes", ".", "windll", ".", "kernel32", ".", "GetConsoleTitleW", "(", "values", ",", "MAX_PATH", ")",...
2cc91060982cc8b777152e698d677cc2989bf263
valid
SetConsoleTitle
SetConsoleTitle from Win32. text: str. Return bool, True if succeed otherwise False.
uiautomation/uiautomation.py
def SetConsoleTitle(text: str) -> bool: """ SetConsoleTitle from Win32. text: str. Return bool, True if succeed otherwise False. """ return bool(ctypes.windll.kernel32.SetConsoleTitleW(ctypes.c_wchar_p(text)))
def SetConsoleTitle(text: str) -> bool: """ SetConsoleTitle from Win32. text: str. Return bool, True if succeed otherwise False. """ return bool(ctypes.windll.kernel32.SetConsoleTitleW(ctypes.c_wchar_p(text)))
[ "SetConsoleTitle", "from", "Win32", ".", "text", ":", "str", ".", "Return", "bool", "True", "if", "succeed", "otherwise", "False", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2273-L2279
[ "def", "SetConsoleTitle", "(", "text", ":", "str", ")", "->", "bool", ":", "return", "bool", "(", "ctypes", ".", "windll", ".", "kernel32", ".", "SetConsoleTitleW", "(", "ctypes", ".", "c_wchar_p", "(", "text", ")", ")", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
IsDesktopLocked
Check if desktop is locked. Return bool. Desktop is locked if press Win+L, Ctrl+Alt+Del or in remote desktop mode.
uiautomation/uiautomation.py
def IsDesktopLocked() -> bool: """ Check if desktop is locked. Return bool. Desktop is locked if press Win+L, Ctrl+Alt+Del or in remote desktop mode. """ isLocked = False desk = ctypes.windll.user32.OpenDesktopW(ctypes.c_wchar_p('Default'), 0, 0, 0x0100) # DESKTOP_SWITCHDESKTOP = 0x0100 ...
def IsDesktopLocked() -> bool: """ Check if desktop is locked. Return bool. Desktop is locked if press Win+L, Ctrl+Alt+Del or in remote desktop mode. """ isLocked = False desk = ctypes.windll.user32.OpenDesktopW(ctypes.c_wchar_p('Default'), 0, 0, 0x0100) # DESKTOP_SWITCHDESKTOP = 0x0100 ...
[ "Check", "if", "desktop", "is", "locked", ".", "Return", "bool", ".", "Desktop", "is", "locked", "if", "press", "Win", "+", "L", "Ctrl", "+", "Alt", "+", "Del", "or", "in", "remote", "desktop", "mode", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2290-L2301
[ "def", "IsDesktopLocked", "(", ")", "->", "bool", ":", "isLocked", "=", "False", "desk", "=", "ctypes", ".", "windll", ".", "user32", ".", "OpenDesktopW", "(", "ctypes", ".", "c_wchar_p", "(", "'Default'", ")", ",", "0", ",", "0", ",", "0x0100", ")", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
PlayWaveFile
Call PlaySound from Win32. filePath: str, if emtpy, stop playing the current sound. isAsync: bool, if True, the sound is played asynchronously and returns immediately. isLoop: bool, if True, the sound plays repeatedly until PlayWaveFile(None) is called again, must also set isAsync to True. Return bool, ...
uiautomation/uiautomation.py
def PlayWaveFile(filePath: str = r'C:\Windows\Media\notify.wav', isAsync: bool = False, isLoop: bool = False) -> bool: """ Call PlaySound from Win32. filePath: str, if emtpy, stop playing the current sound. isAsync: bool, if True, the sound is played asynchronously and returns immediately. isLoop: b...
def PlayWaveFile(filePath: str = r'C:\Windows\Media\notify.wav', isAsync: bool = False, isLoop: bool = False) -> bool: """ Call PlaySound from Win32. filePath: str, if emtpy, stop playing the current sound. isAsync: bool, if True, the sound is played asynchronously and returns immediately. isLoop: b...
[ "Call", "PlaySound", "from", "Win32", ".", "filePath", ":", "str", "if", "emtpy", "stop", "playing", "the", "current", "sound", ".", "isAsync", ":", "bool", "if", "True", "the", "sound", "is", "played", "asynchronously", "and", "returns", "immediately", ".",...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2304-L2325
[ "def", "PlayWaveFile", "(", "filePath", ":", "str", "=", "r'C:\\Windows\\Media\\notify.wav'", ",", "isAsync", ":", "bool", "=", "False", ",", "isLoop", ":", "bool", "=", "False", ")", "->", "bool", ":", "if", "filePath", ":", "SND_ASYNC", "=", "0x0001", "S...
2cc91060982cc8b777152e698d677cc2989bf263
valid
IsProcess64Bit
Return True if process is 64 bit. Return False if process is 32 bit. Return None if unknown, maybe caused by having no acess right to the process.
uiautomation/uiautomation.py
def IsProcess64Bit(processId: int) -> bool: """ Return True if process is 64 bit. Return False if process is 32 bit. Return None if unknown, maybe caused by having no acess right to the process. """ try: func = ctypes.windll.ntdll.ZwWow64ReadVirtualMemory64 #only 64 bit OS has this func...
def IsProcess64Bit(processId: int) -> bool: """ Return True if process is 64 bit. Return False if process is 32 bit. Return None if unknown, maybe caused by having no acess right to the process. """ try: func = ctypes.windll.ntdll.ZwWow64ReadVirtualMemory64 #only 64 bit OS has this func...
[ "Return", "True", "if", "process", "is", "64", "bit", ".", "Return", "False", "if", "process", "is", "32", "bit", ".", "Return", "None", "if", "unknown", "maybe", "caused", "by", "having", "no", "acess", "right", "to", "the", "process", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2328-L2350
[ "def", "IsProcess64Bit", "(", "processId", ":", "int", ")", "->", "bool", ":", "try", ":", "func", "=", "ctypes", ".", "windll", ".", "ntdll", ".", "ZwWow64ReadVirtualMemory64", "#only 64 bit OS has this function", "except", "Exception", "as", "ex", ":", "return...
2cc91060982cc8b777152e698d677cc2989bf263
valid
RunScriptAsAdmin
Run a python script as administrator. System will show a popup dialog askes you whether to elevate as administrator if UAC is enabled. argv: list, a str list like sys.argv, argv[0] is the script file, argv[1:] are other arguments. workingDirectory: str, the working directory for the script file. showFla...
uiautomation/uiautomation.py
def RunScriptAsAdmin(argv: list, workingDirectory: str = None, showFlag: int = SW.ShowNormal) -> bool: """ Run a python script as administrator. System will show a popup dialog askes you whether to elevate as administrator if UAC is enabled. argv: list, a str list like sys.argv, argv[0] is the script fi...
def RunScriptAsAdmin(argv: list, workingDirectory: str = None, showFlag: int = SW.ShowNormal) -> bool: """ Run a python script as administrator. System will show a popup dialog askes you whether to elevate as administrator if UAC is enabled. argv: list, a str list like sys.argv, argv[0] is the script fi...
[ "Run", "a", "python", "script", "as", "administrator", ".", "System", "will", "show", "a", "popup", "dialog", "askes", "you", "whether", "to", "elevate", "as", "administrator", "if", "UAC", "is", "enabled", ".", "argv", ":", "list", "a", "str", "list", "...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2362-L2372
[ "def", "RunScriptAsAdmin", "(", "argv", ":", "list", ",", "workingDirectory", ":", "str", "=", "None", ",", "showFlag", ":", "int", "=", "SW", ".", "ShowNormal", ")", "->", "bool", ":", "args", "=", "' '", ".", "join", "(", "'\"{}\"'", ".", "format", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
SendKey
Simulate typing a key. key: int, a value in class `Keys`.
uiautomation/uiautomation.py
def SendKey(key: int, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate typing a key. key: int, a value in class `Keys`. """ keybd_event(key, 0, KeyboardEventFlag.KeyDown | KeyboardEventFlag.ExtendedKey, 0) keybd_event(key, 0, KeyboardEventFlag.KeyUp | KeyboardEventFlag.ExtendedKey, 0...
def SendKey(key: int, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate typing a key. key: int, a value in class `Keys`. """ keybd_event(key, 0, KeyboardEventFlag.KeyDown | KeyboardEventFlag.ExtendedKey, 0) keybd_event(key, 0, KeyboardEventFlag.KeyUp | KeyboardEventFlag.ExtendedKey, 0...
[ "Simulate", "typing", "a", "key", ".", "key", ":", "int", "a", "value", "in", "class", "Keys", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2375-L2382
[ "def", "SendKey", "(", "key", ":", "int", ",", "waitTime", ":", "float", "=", "OPERATION_WAIT_TIME", ")", "->", "None", ":", "keybd_event", "(", "key", ",", "0", ",", "KeyboardEventFlag", ".", "KeyDown", "|", "KeyboardEventFlag", ".", "ExtendedKey", ",", "...
2cc91060982cc8b777152e698d677cc2989bf263
valid
PressKey
Simulate a key down for key. key: int, a value in class `Keys`. waitTime: float.
uiautomation/uiautomation.py
def PressKey(key: int, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate a key down for key. key: int, a value in class `Keys`. waitTime: float. """ keybd_event(key, 0, KeyboardEventFlag.KeyDown | KeyboardEventFlag.ExtendedKey, 0) time.sleep(waitTime)
def PressKey(key: int, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate a key down for key. key: int, a value in class `Keys`. waitTime: float. """ keybd_event(key, 0, KeyboardEventFlag.KeyDown | KeyboardEventFlag.ExtendedKey, 0) time.sleep(waitTime)
[ "Simulate", "a", "key", "down", "for", "key", ".", "key", ":", "int", "a", "value", "in", "class", "Keys", ".", "waitTime", ":", "float", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2385-L2392
[ "def", "PressKey", "(", "key", ":", "int", ",", "waitTime", ":", "float", "=", "OPERATION_WAIT_TIME", ")", "->", "None", ":", "keybd_event", "(", "key", ",", "0", ",", "KeyboardEventFlag", ".", "KeyDown", "|", "KeyboardEventFlag", ".", "ExtendedKey", ",", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
ReleaseKey
Simulate a key up for key. key: int, a value in class `Keys`. waitTime: float.
uiautomation/uiautomation.py
def ReleaseKey(key: int, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate a key up for key. key: int, a value in class `Keys`. waitTime: float. """ keybd_event(key, 0, KeyboardEventFlag.KeyUp | KeyboardEventFlag.ExtendedKey, 0) time.sleep(waitTime)
def ReleaseKey(key: int, waitTime: float = OPERATION_WAIT_TIME) -> None: """ Simulate a key up for key. key: int, a value in class `Keys`. waitTime: float. """ keybd_event(key, 0, KeyboardEventFlag.KeyUp | KeyboardEventFlag.ExtendedKey, 0) time.sleep(waitTime)
[ "Simulate", "a", "key", "up", "for", "key", ".", "key", ":", "int", "a", "value", "in", "class", "Keys", ".", "waitTime", ":", "float", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2395-L2402
[ "def", "ReleaseKey", "(", "key", ":", "int", ",", "waitTime", ":", "float", "=", "OPERATION_WAIT_TIME", ")", "->", "None", ":", "keybd_event", "(", "key", ",", "0", ",", "KeyboardEventFlag", ".", "KeyUp", "|", "KeyboardEventFlag", ".", "ExtendedKey", ",", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
IsKeyPressed
key: int, a value in class `Keys`. Return bool.
uiautomation/uiautomation.py
def IsKeyPressed(key: int) -> bool: """ key: int, a value in class `Keys`. Return bool. """ state = ctypes.windll.user32.GetAsyncKeyState(key) return bool(state & 0x8000)
def IsKeyPressed(key: int) -> bool: """ key: int, a value in class `Keys`. Return bool. """ state = ctypes.windll.user32.GetAsyncKeyState(key) return bool(state & 0x8000)
[ "key", ":", "int", "a", "value", "in", "class", "Keys", ".", "Return", "bool", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2405-L2411
[ "def", "IsKeyPressed", "(", "key", ":", "int", ")", "->", "bool", ":", "state", "=", "ctypes", ".", "windll", ".", "user32", ".", "GetAsyncKeyState", "(", "key", ")", "return", "bool", "(", "state", "&", "0x8000", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
_CreateInput
Create Win32 struct `INPUT` for `SendInput`. Return `INPUT`.
uiautomation/uiautomation.py
def _CreateInput(structure) -> INPUT: """ Create Win32 struct `INPUT` for `SendInput`. Return `INPUT`. """ if isinstance(structure, MOUSEINPUT): return INPUT(InputType.Mouse, _INPUTUnion(mi=structure)) if isinstance(structure, KEYBDINPUT): return INPUT(InputType.Keyboard, _INPUTU...
def _CreateInput(structure) -> INPUT: """ Create Win32 struct `INPUT` for `SendInput`. Return `INPUT`. """ if isinstance(structure, MOUSEINPUT): return INPUT(InputType.Mouse, _INPUTUnion(mi=structure)) if isinstance(structure, KEYBDINPUT): return INPUT(InputType.Keyboard, _INPUTU...
[ "Create", "Win32", "struct", "INPUT", "for", "SendInput", ".", "Return", "INPUT", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2414-L2425
[ "def", "_CreateInput", "(", "structure", ")", "->", "INPUT", ":", "if", "isinstance", "(", "structure", ",", "MOUSEINPUT", ")", ":", "return", "INPUT", "(", "InputType", ".", "Mouse", ",", "_INPUTUnion", "(", "mi", "=", "structure", ")", ")", "if", "isin...
2cc91060982cc8b777152e698d677cc2989bf263
valid
MouseInput
Create Win32 struct `MOUSEINPUT` for `SendInput`. Return `INPUT`.
uiautomation/uiautomation.py
def MouseInput(dx: int, dy: int, mouseData: int = 0, dwFlags: int = MouseEventFlag.LeftDown, time_: int = 0) -> INPUT: """ Create Win32 struct `MOUSEINPUT` for `SendInput`. Return `INPUT`. """ return _CreateInput(MOUSEINPUT(dx, dy, mouseData, dwFlags, time_, None))
def MouseInput(dx: int, dy: int, mouseData: int = 0, dwFlags: int = MouseEventFlag.LeftDown, time_: int = 0) -> INPUT: """ Create Win32 struct `MOUSEINPUT` for `SendInput`. Return `INPUT`. """ return _CreateInput(MOUSEINPUT(dx, dy, mouseData, dwFlags, time_, None))
[ "Create", "Win32", "struct", "MOUSEINPUT", "for", "SendInput", ".", "Return", "INPUT", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2428-L2433
[ "def", "MouseInput", "(", "dx", ":", "int", ",", "dy", ":", "int", ",", "mouseData", ":", "int", "=", "0", ",", "dwFlags", ":", "int", "=", "MouseEventFlag", ".", "LeftDown", ",", "time_", ":", "int", "=", "0", ")", "->", "INPUT", ":", "return", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
KeyboardInput
Create Win32 struct `KEYBDINPUT` for `SendInput`.
uiautomation/uiautomation.py
def KeyboardInput(wVk: int, wScan: int, dwFlags: int = KeyboardEventFlag.KeyDown, time_: int = 0) -> INPUT: """Create Win32 struct `KEYBDINPUT` for `SendInput`.""" return _CreateInput(KEYBDINPUT(wVk, wScan, dwFlags, time_, None))
def KeyboardInput(wVk: int, wScan: int, dwFlags: int = KeyboardEventFlag.KeyDown, time_: int = 0) -> INPUT: """Create Win32 struct `KEYBDINPUT` for `SendInput`.""" return _CreateInput(KEYBDINPUT(wVk, wScan, dwFlags, time_, None))
[ "Create", "Win32", "struct", "KEYBDINPUT", "for", "SendInput", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2436-L2438
[ "def", "KeyboardInput", "(", "wVk", ":", "int", ",", "wScan", ":", "int", ",", "dwFlags", ":", "int", "=", "KeyboardEventFlag", ".", "KeyDown", ",", "time_", ":", "int", "=", "0", ")", "->", "INPUT", ":", "return", "_CreateInput", "(", "KEYBDINPUT", "(...
2cc91060982cc8b777152e698d677cc2989bf263
valid
HardwareInput
Create Win32 struct `HARDWAREINPUT` for `SendInput`.
uiautomation/uiautomation.py
def HardwareInput(uMsg: int, param: int = 0) -> INPUT: """Create Win32 struct `HARDWAREINPUT` for `SendInput`.""" return _CreateInput(HARDWAREINPUT(uMsg, param & 0xFFFF, param >> 16 & 0xFFFF))
def HardwareInput(uMsg: int, param: int = 0) -> INPUT: """Create Win32 struct `HARDWAREINPUT` for `SendInput`.""" return _CreateInput(HARDWAREINPUT(uMsg, param & 0xFFFF, param >> 16 & 0xFFFF))
[ "Create", "Win32", "struct", "HARDWAREINPUT", "for", "SendInput", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2441-L2443
[ "def", "HardwareInput", "(", "uMsg", ":", "int", ",", "param", ":", "int", "=", "0", ")", "->", "INPUT", ":", "return", "_CreateInput", "(", "HARDWAREINPUT", "(", "uMsg", ",", "param", "&", "0xFFFF", ",", "param", ">>", "16", "&", "0xFFFF", ")", ")" ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
SendUnicodeChar
Type a single unicode char. char: str, len(char) must equal to 1. Return int, the number of events that it successfully inserted into the keyboard or mouse input stream. If the function returns zero, the input was already blocked by another thread.
uiautomation/uiautomation.py
def SendUnicodeChar(char: str) -> int: """ Type a single unicode char. char: str, len(char) must equal to 1. Return int, the number of events that it successfully inserted into the keyboard or mouse input stream. If the function returns zero, the input was already blocked by another thre...
def SendUnicodeChar(char: str) -> int: """ Type a single unicode char. char: str, len(char) must equal to 1. Return int, the number of events that it successfully inserted into the keyboard or mouse input stream. If the function returns zero, the input was already blocked by another thre...
[ "Type", "a", "single", "unicode", "char", ".", "char", ":", "str", "len", "(", "char", ")", "must", "equal", "to", "1", ".", "Return", "int", "the", "number", "of", "events", "that", "it", "successfully", "inserted", "into", "the", "keyboard", "or", "m...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2460-L2468
[ "def", "SendUnicodeChar", "(", "char", ":", "str", ")", "->", "int", ":", "return", "SendInput", "(", "KeyboardInput", "(", "0", ",", "ord", "(", "char", ")", ",", "KeyboardEventFlag", ".", "KeyUnicode", "|", "KeyboardEventFlag", ".", "KeyDown", ")", ",", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
_VKtoSC
This function is only for internal use in SendKeys. key: int, a value in class `Keys`. Return int.
uiautomation/uiautomation.py
def _VKtoSC(key: int) -> int: """ This function is only for internal use in SendKeys. key: int, a value in class `Keys`. Return int. """ if key in _SCKeys: return _SCKeys[key] scanCode = ctypes.windll.user32.MapVirtualKeyA(key, 0) if not scanCode: return 0 keyList = [...
def _VKtoSC(key: int) -> int: """ This function is only for internal use in SendKeys. key: int, a value in class `Keys`. Return int. """ if key in _SCKeys: return _SCKeys[key] scanCode = ctypes.windll.user32.MapVirtualKeyA(key, 0) if not scanCode: return 0 keyList = [...
[ "This", "function", "is", "only", "for", "internal", "use", "in", "SendKeys", ".", "key", ":", "int", "a", "value", "in", "class", "Keys", ".", "Return", "int", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2499-L2513
[ "def", "_VKtoSC", "(", "key", ":", "int", ")", "->", "int", ":", "if", "key", "in", "_SCKeys", ":", "return", "_SCKeys", "[", "key", "]", "scanCode", "=", "ctypes", ".", "windll", ".", "user32", ".", "MapVirtualKeyA", "(", "key", ",", "0", ")", "if...
2cc91060982cc8b777152e698d677cc2989bf263
valid
SendKeys
Simulate typing keys on keyboard. text: str, keys to type. interval: float, seconds between keys. waitTime: float. debug: bool, if True, print the keys. Examples: {Ctrl}, {Delete} ... are special keys' name in SpecialKeyNames. SendKeys('{Ctrl}a{Delete}{Ctrl}v{Ctrl}s{Ctrl}{Shift}s{Win}e{PageD...
uiautomation/uiautomation.py
def SendKeys(text: str, interval: float = 0.01, waitTime: float = OPERATION_WAIT_TIME, debug: bool = False) -> None: """ Simulate typing keys on keyboard. text: str, keys to type. interval: float, seconds between keys. waitTime: float. debug: bool, if True, print the keys. Examples: {Ctr...
def SendKeys(text: str, interval: float = 0.01, waitTime: float = OPERATION_WAIT_TIME, debug: bool = False) -> None: """ Simulate typing keys on keyboard. text: str, keys to type. interval: float, seconds between keys. waitTime: float. debug: bool, if True, print the keys. Examples: {Ctr...
[ "Simulate", "typing", "keys", "on", "keyboard", ".", "text", ":", "str", "keys", "to", "type", ".", "interval", ":", "float", "seconds", "between", "keys", ".", "waitTime", ":", "float", ".", "debug", ":", "bool", "if", "True", "print", "the", "keys", ...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2516-L2701
[ "def", "SendKeys", "(", "text", ":", "str", ",", "interval", ":", "float", "=", "0.01", ",", "waitTime", ":", "float", "=", "OPERATION_WAIT_TIME", ",", "debug", ":", "bool", "=", "False", ")", "->", "None", ":", "holdKeys", "=", "(", "'WIN'", ",", "'...
2cc91060982cc8b777152e698d677cc2989bf263
valid
GetPatternIdInterface
Get pattern COM interface by pattern id. patternId: int, a value in class `PatternId`. Return comtypes._cominterface_meta.
uiautomation/uiautomation.py
def GetPatternIdInterface(patternId: int): """ Get pattern COM interface by pattern id. patternId: int, a value in class `PatternId`. Return comtypes._cominterface_meta. """ global _PatternIdInterfaces if not _PatternIdInterfaces: _PatternIdInterfaces = { # PatternId.Anno...
def GetPatternIdInterface(patternId: int): """ Get pattern COM interface by pattern id. patternId: int, a value in class `PatternId`. Return comtypes._cominterface_meta. """ global _PatternIdInterfaces if not _PatternIdInterfaces: _PatternIdInterfaces = { # PatternId.Anno...
[ "Get", "pattern", "COM", "interface", "by", "pattern", "id", ".", "patternId", ":", "int", "a", "value", "in", "class", "PatternId", ".", "Return", "comtypes", ".", "_cominterface_meta", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L3187-L3281
[ "def", "GetPatternIdInterface", "(", "patternId", ":", "int", ")", ":", "global", "_PatternIdInterfaces", "if", "not", "_PatternIdInterfaces", ":", "_PatternIdInterfaces", "=", "{", "# PatternId.AnnotationPattern: _AutomationClient.instance().UIAutomationCore.IUIAutomationAnnotatio...
2cc91060982cc8b777152e698d677cc2989bf263
valid
CreatePattern
Create a concreate pattern by pattern id and pattern(POINTER(IUnknown)).
uiautomation/uiautomation.py
def CreatePattern(patternId: int, pattern: ctypes.POINTER(comtypes.IUnknown)): """Create a concreate pattern by pattern id and pattern(POINTER(IUnknown)).""" subPattern = pattern.QueryInterface(GetPatternIdInterface(patternId)) if subPattern: return PatternConstructors[patternId](pattern=subPattern)
def CreatePattern(patternId: int, pattern: ctypes.POINTER(comtypes.IUnknown)): """Create a concreate pattern by pattern id and pattern(POINTER(IUnknown)).""" subPattern = pattern.QueryInterface(GetPatternIdInterface(patternId)) if subPattern: return PatternConstructors[patternId](pattern=subPattern)
[ "Create", "a", "concreate", "pattern", "by", "pattern", "id", "and", "pattern", "(", "POINTER", "(", "IUnknown", "))", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L5144-L5148
[ "def", "CreatePattern", "(", "patternId", ":", "int", ",", "pattern", ":", "ctypes", ".", "POINTER", "(", "comtypes", ".", "IUnknown", ")", ")", ":", "subPattern", "=", "pattern", ".", "QueryInterface", "(", "GetPatternIdInterface", "(", "patternId", ")", ")...
2cc91060982cc8b777152e698d677cc2989bf263
valid
WalkTree
Walk a tree not using recursive algorithm. top: a tree node. getChildren: function(treeNode) -> list. getNextSibling: function(treeNode) -> treeNode. getNextSibling: function(treeNode) -> treeNode. yieldCondition: function(treeNode, depth) -> bool. includeTop: bool, if True yield top first. ...
uiautomation/uiautomation.py
def WalkTree(top, getChildren: Callable = None, getFirstChild: Callable = None, getNextSibling: Callable = None, yieldCondition: Callable = None, includeTop: bool = False, maxDepth: int = 0xFFFFFFFF): """ Walk a tree not using recursive algorithm. top: a tree node. getChildren: function(treeNode) -> lis...
def WalkTree(top, getChildren: Callable = None, getFirstChild: Callable = None, getNextSibling: Callable = None, yieldCondition: Callable = None, includeTop: bool = False, maxDepth: int = 0xFFFFFFFF): """ Walk a tree not using recursive algorithm. top: a tree node. getChildren: function(treeNode) -> lis...
[ "Walk", "a", "tree", "not", "using", "recursive", "algorithm", ".", "top", ":", "a", "tree", "node", ".", "getChildren", ":", "function", "(", "treeNode", ")", "-", ">", "list", ".", "getNextSibling", ":", "function", "(", "treeNode", ")", "-", ">", "t...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L7367-L7434
[ "def", "WalkTree", "(", "top", ",", "getChildren", ":", "Callable", "=", "None", ",", "getFirstChild", ":", "Callable", "=", "None", ",", "getNextSibling", ":", "Callable", "=", "None", ",", "yieldCondition", ":", "Callable", "=", "None", ",", "includeTop", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
ControlFromPoint
Call IUIAutomation ElementFromPoint x,y. May return None if mouse is over cmd's title bar icon. Return `Control` subclass or None.
uiautomation/uiautomation.py
def ControlFromPoint(x: int, y: int) -> Control: """ Call IUIAutomation ElementFromPoint x,y. May return None if mouse is over cmd's title bar icon. Return `Control` subclass or None. """ element = _AutomationClient.instance().IUIAutomation.ElementFromPoint(ctypes.wintypes.POINT(x, y)) return Co...
def ControlFromPoint(x: int, y: int) -> Control: """ Call IUIAutomation ElementFromPoint x,y. May return None if mouse is over cmd's title bar icon. Return `Control` subclass or None. """ element = _AutomationClient.instance().IUIAutomation.ElementFromPoint(ctypes.wintypes.POINT(x, y)) return Co...
[ "Call", "IUIAutomation", "ElementFromPoint", "x", "y", ".", "May", "return", "None", "if", "mouse", "is", "over", "cmd", "s", "title", "bar", "icon", ".", "Return", "Control", "subclass", "or", "None", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L7472-L7478
[ "def", "ControlFromPoint", "(", "x", ":", "int", ",", "y", ":", "int", ")", "->", "Control", ":", "element", "=", "_AutomationClient", ".", "instance", "(", ")", ".", "IUIAutomation", ".", "ElementFromPoint", "(", "ctypes", ".", "wintypes", ".", "POINT", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
ControlFromPoint2
Get a native handle from point x,y and call IUIAutomation.ElementFromHandle. Return `Control` subclass.
uiautomation/uiautomation.py
def ControlFromPoint2(x: int, y: int) -> Control: """ Get a native handle from point x,y and call IUIAutomation.ElementFromHandle. Return `Control` subclass. """ return Control.CreateControlFromElement(_AutomationClient.instance().IUIAutomation.ElementFromHandle(WindowFromPoint(x, y)))
def ControlFromPoint2(x: int, y: int) -> Control: """ Get a native handle from point x,y and call IUIAutomation.ElementFromHandle. Return `Control` subclass. """ return Control.CreateControlFromElement(_AutomationClient.instance().IUIAutomation.ElementFromHandle(WindowFromPoint(x, y)))
[ "Get", "a", "native", "handle", "from", "point", "x", "y", "and", "call", "IUIAutomation", ".", "ElementFromHandle", ".", "Return", "Control", "subclass", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L7481-L7486
[ "def", "ControlFromPoint2", "(", "x", ":", "int", ",", "y", ":", "int", ")", "->", "Control", ":", "return", "Control", ".", "CreateControlFromElement", "(", "_AutomationClient", ".", "instance", "(", ")", ".", "IUIAutomation", ".", "ElementFromHandle", "(", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
ControlFromHandle
Call IUIAutomation.ElementFromHandle with a native handle. handle: int, a native window handle. Return `Control` subclass.
uiautomation/uiautomation.py
def ControlFromHandle(handle: int) -> Control: """ Call IUIAutomation.ElementFromHandle with a native handle. handle: int, a native window handle. Return `Control` subclass. """ return Control.CreateControlFromElement(_AutomationClient.instance().IUIAutomation.ElementFromHandle(handle))
def ControlFromHandle(handle: int) -> Control: """ Call IUIAutomation.ElementFromHandle with a native handle. handle: int, a native window handle. Return `Control` subclass. """ return Control.CreateControlFromElement(_AutomationClient.instance().IUIAutomation.ElementFromHandle(handle))
[ "Call", "IUIAutomation", ".", "ElementFromHandle", "with", "a", "native", "handle", ".", "handle", ":", "int", "a", "native", "window", "handle", ".", "Return", "Control", "subclass", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L7507-L7513
[ "def", "ControlFromHandle", "(", "handle", ":", "int", ")", "->", "Control", ":", "return", "Control", ".", "CreateControlFromElement", "(", "_AutomationClient", ".", "instance", "(", ")", ".", "IUIAutomation", ".", "ElementFromHandle", "(", "handle", ")", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
ControlsAreSame
control1: `Control` or its subclass. control2: `Control` or its subclass. Return bool, True if control1 and control2 represent the same control otherwise False.
uiautomation/uiautomation.py
def ControlsAreSame(control1: Control, control2: Control) -> bool: """ control1: `Control` or its subclass. control2: `Control` or its subclass. Return bool, True if control1 and control2 represent the same control otherwise False. """ return bool(_AutomationClient.instance().IUIAutomation.Compa...
def ControlsAreSame(control1: Control, control2: Control) -> bool: """ control1: `Control` or its subclass. control2: `Control` or its subclass. Return bool, True if control1 and control2 represent the same control otherwise False. """ return bool(_AutomationClient.instance().IUIAutomation.Compa...
[ "control1", ":", "Control", "or", "its", "subclass", ".", "control2", ":", "Control", "or", "its", "subclass", ".", "Return", "bool", "True", "if", "control1", "and", "control2", "represent", "the", "same", "control", "otherwise", "False", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L7516-L7522
[ "def", "ControlsAreSame", "(", "control1", ":", "Control", ",", "control2", ":", "Control", ")", "->", "bool", ":", "return", "bool", "(", "_AutomationClient", ".", "instance", "(", ")", ".", "IUIAutomation", ".", "CompareElements", "(", "control1", ".", "El...
2cc91060982cc8b777152e698d677cc2989bf263
valid
WalkControl
control: `Control` or its subclass. includeTop: bool, if True, yield (control, 0) first. maxDepth: int, enum depth. Yield 2 items tuple(control: Control, depth: int).
uiautomation/uiautomation.py
def WalkControl(control: Control, includeTop: bool = False, maxDepth: int = 0xFFFFFFFF): """ control: `Control` or its subclass. includeTop: bool, if True, yield (control, 0) first. maxDepth: int, enum depth. Yield 2 items tuple(control: Control, depth: int). """ if includeTop: yield...
def WalkControl(control: Control, includeTop: bool = False, maxDepth: int = 0xFFFFFFFF): """ control: `Control` or its subclass. includeTop: bool, if True, yield (control, 0) first. maxDepth: int, enum depth. Yield 2 items tuple(control: Control, depth: int). """ if includeTop: yield...
[ "control", ":", "Control", "or", "its", "subclass", ".", "includeTop", ":", "bool", "if", "True", "yield", "(", "control", "0", ")", "first", ".", "maxDepth", ":", "int", "enum", "depth", ".", "Yield", "2", "items", "tuple", "(", "control", ":", "Contr...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L7525-L7552
[ "def", "WalkControl", "(", "control", ":", "Control", ",", "includeTop", ":", "bool", "=", "False", ",", "maxDepth", ":", "int", "=", "0xFFFFFFFF", ")", ":", "if", "includeTop", ":", "yield", "control", ",", "0", "if", "maxDepth", "<=", "0", ":", "retu...
2cc91060982cc8b777152e698d677cc2989bf263
valid
LogControl
Print and log control's properties. control: `Control` or its subclass. depth: int, current depth. showAllName: bool, if False, print the first 30 characters of control.Name.
uiautomation/uiautomation.py
def LogControl(control: Control, depth: int = 0, showAllName: bool = True) -> None: """ Print and log control's properties. control: `Control` or its subclass. depth: int, current depth. showAllName: bool, if False, print the first 30 characters of control.Name. """ def getKeyName(theDict, t...
def LogControl(control: Control, depth: int = 0, showAllName: bool = True) -> None: """ Print and log control's properties. control: `Control` or its subclass. depth: int, current depth. showAllName: bool, if False, print the first 30 characters of control.Name. """ def getKeyName(theDict, t...
[ "Print", "and", "log", "control", "s", "properties", ".", "control", ":", "Control", "or", "its", "subclass", ".", "depth", ":", "int", "current", "depth", ".", "showAllName", ":", "bool", "if", "False", "print", "the", "first", "30", "characters", "of", ...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L7555-L7619
[ "def", "LogControl", "(", "control", ":", "Control", ",", "depth", ":", "int", "=", "0", ",", "showAllName", ":", "bool", "=", "True", ")", "->", "None", ":", "def", "getKeyName", "(", "theDict", ",", "theValue", ")", ":", "for", "key", "in", "theDic...
2cc91060982cc8b777152e698d677cc2989bf263
valid
EnumAndLogControl
Print and log control and its descendants' propertyies. control: `Control` or its subclass. maxDepth: int, enum depth. showAllName: bool, if False, print the first 30 characters of control.Name. startDepth: int, control's current depth.
uiautomation/uiautomation.py
def EnumAndLogControl(control: Control, maxDepth: int = 0xFFFFFFFF, showAllName: bool = True, startDepth: int = 0) -> None: """ Print and log control and its descendants' propertyies. control: `Control` or its subclass. maxDepth: int, enum depth. showAllName: bool, if False, print the first 30 chara...
def EnumAndLogControl(control: Control, maxDepth: int = 0xFFFFFFFF, showAllName: bool = True, startDepth: int = 0) -> None: """ Print and log control and its descendants' propertyies. control: `Control` or its subclass. maxDepth: int, enum depth. showAllName: bool, if False, print the first 30 chara...
[ "Print", "and", "log", "control", "and", "its", "descendants", "propertyies", ".", "control", ":", "Control", "or", "its", "subclass", ".", "maxDepth", ":", "int", "enum", "depth", ".", "showAllName", ":", "bool", "if", "False", "print", "the", "first", "3...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L7622-L7631
[ "def", "EnumAndLogControl", "(", "control", ":", "Control", ",", "maxDepth", ":", "int", "=", "0xFFFFFFFF", ",", "showAllName", ":", "bool", "=", "True", ",", "startDepth", ":", "int", "=", "0", ")", "->", "None", ":", "for", "c", ",", "d", "in", "Wa...
2cc91060982cc8b777152e698d677cc2989bf263
valid
EnumAndLogControlAncestors
Print and log control and its ancestors' propertyies. control: `Control` or its subclass. showAllName: bool, if False, print the first 30 characters of control.Name.
uiautomation/uiautomation.py
def EnumAndLogControlAncestors(control: Control, showAllName: bool = True) -> None: """ Print and log control and its ancestors' propertyies. control: `Control` or its subclass. showAllName: bool, if False, print the first 30 characters of control.Name. """ lists = [] while control: ...
def EnumAndLogControlAncestors(control: Control, showAllName: bool = True) -> None: """ Print and log control and its ancestors' propertyies. control: `Control` or its subclass. showAllName: bool, if False, print the first 30 characters of control.Name. """ lists = [] while control: ...
[ "Print", "and", "log", "control", "and", "its", "ancestors", "propertyies", ".", "control", ":", "Control", "or", "its", "subclass", ".", "showAllName", ":", "bool", "if", "False", "print", "the", "first", "30", "characters", "of", "control", ".", "Name", ...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L7634-L7645
[ "def", "EnumAndLogControlAncestors", "(", "control", ":", "Control", ",", "showAllName", ":", "bool", "=", "True", ")", "->", "None", ":", "lists", "=", "[", "]", "while", "control", ":", "lists", ".", "insert", "(", "0", ",", "control", ")", "control", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
FindControl
control: `Control` or its subclass. compare: compare function with parameters (control: Control, depth: int) which returns bool. maxDepth: int, enum depth. findFromSelf: bool, if False, do not compare self. foundIndex: int, starts with 1, >= 1. Return `Control` subclass or None if not find.
uiautomation/uiautomation.py
def FindControl(control: Control, compare: Callable, maxDepth: int = 0xFFFFFFFF, findFromSelf: bool = False, foundIndex: int = 1) -> Control: """ control: `Control` or its subclass. compare: compare function with parameters (control: Control, depth: int) which returns bool. maxDepth: int, enum depth. ...
def FindControl(control: Control, compare: Callable, maxDepth: int = 0xFFFFFFFF, findFromSelf: bool = False, foundIndex: int = 1) -> Control: """ control: `Control` or its subclass. compare: compare function with parameters (control: Control, depth: int) which returns bool. maxDepth: int, enum depth. ...
[ "control", ":", "Control", "or", "its", "subclass", ".", "compare", ":", "compare", "function", "with", "parameters", "(", "control", ":", "Control", "depth", ":", "int", ")", "which", "returns", "bool", ".", "maxDepth", ":", "int", "enum", "depth", ".", ...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L7648-L7667
[ "def", "FindControl", "(", "control", ":", "Control", ",", "compare", ":", "Callable", ",", "maxDepth", ":", "int", "=", "0xFFFFFFFF", ",", "findFromSelf", ":", "bool", "=", "False", ",", "foundIndex", ":", "int", "=", "1", ")", "->", "Control", ":", "...
2cc91060982cc8b777152e698d677cc2989bf263
valid
WaitHotKeyReleased
hotkey: tuple, two ints tuple(modifierKey, key)
uiautomation/uiautomation.py
def WaitHotKeyReleased(hotkey: tuple) -> None: """hotkey: tuple, two ints tuple(modifierKey, key)""" mod = {ModifierKey.Alt: Keys.VK_MENU, ModifierKey.Control: Keys.VK_CONTROL, ModifierKey.Shift: Keys.VK_SHIFT, ModifierKey.Win: Keys.VK_LWIN } while Tru...
def WaitHotKeyReleased(hotkey: tuple) -> None: """hotkey: tuple, two ints tuple(modifierKey, key)""" mod = {ModifierKey.Alt: Keys.VK_MENU, ModifierKey.Control: Keys.VK_CONTROL, ModifierKey.Shift: Keys.VK_SHIFT, ModifierKey.Win: Keys.VK_LWIN } while Tru...
[ "hotkey", ":", "tuple", "two", "ints", "tuple", "(", "modifierKey", "key", ")" ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L7703-L7719
[ "def", "WaitHotKeyReleased", "(", "hotkey", ":", "tuple", ")", "->", "None", ":", "mod", "=", "{", "ModifierKey", ".", "Alt", ":", "Keys", ".", "VK_MENU", ",", "ModifierKey", ".", "Control", ":", "Keys", ".", "VK_CONTROL", ",", "ModifierKey", ".", "Shift...
2cc91060982cc8b777152e698d677cc2989bf263
valid
RunByHotKey
Bind functions with hotkeys, the function will be run or stopped in another thread when the hotkey is pressed. keyFunctions: hotkey function dict, like {(uiautomation.ModifierKey.Control, uiautomation.Keys.VK_1) : func} stopHotKey: hotkey tuple exitHotKey: hotkey tuple waitHotKeyReleased: bool, if True,...
uiautomation/uiautomation.py
def RunByHotKey(keyFunctions: dict, stopHotKey: tuple = None, exitHotKey: tuple = (ModifierKey.Control, Keys.VK_D), waitHotKeyReleased: bool = True) -> None: """ Bind functions with hotkeys, the function will be run or stopped in another thread when the hotkey is pressed. keyFunctions: hotkey function dict,...
def RunByHotKey(keyFunctions: dict, stopHotKey: tuple = None, exitHotKey: tuple = (ModifierKey.Control, Keys.VK_D), waitHotKeyReleased: bool = True) -> None: """ Bind functions with hotkeys, the function will be run or stopped in another thread when the hotkey is pressed. keyFunctions: hotkey function dict,...
[ "Bind", "functions", "with", "hotkeys", "the", "function", "will", "be", "run", "or", "stopped", "in", "another", "thread", "when", "the", "hotkey", "is", "pressed", ".", "keyFunctions", ":", "hotkey", "function", "dict", "like", "{", "(", "uiautomation", "....
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L7722-L7859
[ "def", "RunByHotKey", "(", "keyFunctions", ":", "dict", ",", "stopHotKey", ":", "tuple", "=", "None", ",", "exitHotKey", ":", "tuple", "=", "(", "ModifierKey", ".", "Control", ",", "Keys", ".", "VK_D", ")", ",", "waitHotKeyReleased", ":", "bool", "=", "T...
2cc91060982cc8b777152e698d677cc2989bf263
valid
Logger.Write
log: any type. consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`. writeToFile: bool. printToStdout: bool. logFile: str, log file path. printTruncateLen: int, if <= 0, log is not truncated when print.
uiautomation/uiautomation.py
def Write(log: Any, consoleColor: int = ConsoleColor.Default, writeToFile: bool = True, printToStdout: bool = True, logFile: str = None, printTruncateLen: int = 0) -> None: """ log: any type. consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`. writeToFil...
def Write(log: Any, consoleColor: int = ConsoleColor.Default, writeToFile: bool = True, printToStdout: bool = True, logFile: str = None, printTruncateLen: int = 0) -> None: """ log: any type. consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`. writeToFil...
[ "log", ":", "any", "type", ".", "consoleColor", ":", "int", "a", "value", "in", "class", "ConsoleColor", "such", "as", "ConsoleColor", ".", "DarkGreen", ".", "writeToFile", ":", "bool", ".", "printToStdout", ":", "bool", ".", "logFile", ":", "str", "log", ...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2762-L2802
[ "def", "Write", "(", "log", ":", "Any", ",", "consoleColor", ":", "int", "=", "ConsoleColor", ".", "Default", ",", "writeToFile", ":", "bool", "=", "True", ",", "printToStdout", ":", "bool", "=", "True", ",", "logFile", ":", "str", "=", "None", ",", ...
2cc91060982cc8b777152e698d677cc2989bf263
valid
Logger.WriteLine
log: any type. consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`. writeToFile: bool. printToStdout: bool. logFile: str, log file path.
uiautomation/uiautomation.py
def WriteLine(log: Any, consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: str = None) -> None: """ log: any type. consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`. writeToFile: bool. printToStdout: bool. ...
def WriteLine(log: Any, consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: str = None) -> None: """ log: any type. consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`. writeToFile: bool. printToStdout: bool. ...
[ "log", ":", "any", "type", ".", "consoleColor", ":", "int", "a", "value", "in", "class", "ConsoleColor", "such", "as", "ConsoleColor", ".", "DarkGreen", ".", "writeToFile", ":", "bool", ".", "printToStdout", ":", "bool", ".", "logFile", ":", "str", "log", ...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2805-L2813
[ "def", "WriteLine", "(", "log", ":", "Any", ",", "consoleColor", ":", "int", "=", "-", "1", ",", "writeToFile", ":", "bool", "=", "True", ",", "printToStdout", ":", "bool", "=", "True", ",", "logFile", ":", "str", "=", "None", ")", "->", "None", ":...
2cc91060982cc8b777152e698d677cc2989bf263
valid
Logger.ColorfullyWrite
log: str. consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`. writeToFile: bool. printToStdout: bool. logFile: str, log file path. ColorfullyWrite('Hello <Color=Green>Green</Color> !!!'), color name must be in Logger.ColorNames.
uiautomation/uiautomation.py
def ColorfullyWrite(log: str, consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: str = None) -> None: """ log: str. consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`. writeToFile: bool. printToStdout: bool. ...
def ColorfullyWrite(log: str, consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: str = None) -> None: """ log: str. consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`. writeToFile: bool. printToStdout: bool. ...
[ "log", ":", "str", ".", "consoleColor", ":", "int", "a", "value", "in", "class", "ConsoleColor", "such", "as", "ConsoleColor", ".", "DarkGreen", ".", "writeToFile", ":", "bool", ".", "printToStdout", ":", "bool", ".", "logFile", ":", "str", "log", "file", ...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2816-L2842
[ "def", "ColorfullyWrite", "(", "log", ":", "str", ",", "consoleColor", ":", "int", "=", "-", "1", ",", "writeToFile", ":", "bool", "=", "True", ",", "printToStdout", ":", "bool", "=", "True", ",", "logFile", ":", "str", "=", "None", ")", "->", "None"...
2cc91060982cc8b777152e698d677cc2989bf263
valid
Logger.ColorfullyWriteLine
log: str. consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`. writeToFile: bool. printToStdout: bool. logFile: str, log file path. ColorfullyWriteLine('Hello <Color=Green>Green</Color> !!!'), color name must be in Logger.ColorNames.
uiautomation/uiautomation.py
def ColorfullyWriteLine(log: str, consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: str = None) -> None: """ log: str. consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`. writeToFile: bool. printToStdout: bool...
def ColorfullyWriteLine(log: str, consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: str = None) -> None: """ log: str. consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`. writeToFile: bool. printToStdout: bool...
[ "log", ":", "str", ".", "consoleColor", ":", "int", "a", "value", "in", "class", "ConsoleColor", "such", "as", "ConsoleColor", ".", "DarkGreen", ".", "writeToFile", ":", "bool", ".", "printToStdout", ":", "bool", ".", "logFile", ":", "str", "log", "file", ...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2845-L2855
[ "def", "ColorfullyWriteLine", "(", "log", ":", "str", ",", "consoleColor", ":", "int", "=", "-", "1", ",", "writeToFile", ":", "bool", "=", "True", ",", "printToStdout", ":", "bool", "=", "True", ",", "logFile", ":", "str", "=", "None", ")", "->", "N...
2cc91060982cc8b777152e698d677cc2989bf263
valid
Logger.Log
log: any type. consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`. writeToFile: bool. printToStdout: bool. logFile: str, log file path.
uiautomation/uiautomation.py
def Log(log: Any = '', consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: str = None) -> None: """ log: any type. consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`. writeToFile: bool. printToStdout: bool. ...
def Log(log: Any = '', consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: str = None) -> None: """ log: any type. consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`. writeToFile: bool. printToStdout: bool. ...
[ "log", ":", "any", "type", ".", "consoleColor", ":", "int", "a", "value", "in", "class", "ConsoleColor", "such", "as", "ConsoleColor", ".", "DarkGreen", ".", "writeToFile", ":", "bool", ".", "printToStdout", ":", "bool", ".", "logFile", ":", "str", "log", ...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2858-L2870
[ "def", "Log", "(", "log", ":", "Any", "=", "''", ",", "consoleColor", ":", "int", "=", "-", "1", ",", "writeToFile", ":", "bool", "=", "True", ",", "printToStdout", ":", "bool", "=", "True", ",", "logFile", ":", "str", "=", "None", ")", "->", "No...
2cc91060982cc8b777152e698d677cc2989bf263
valid
Logger.DeleteLog
Delete log file.
uiautomation/uiautomation.py
def DeleteLog() -> None: """Delete log file.""" if os.path.exists(Logger.FileName): os.remove(Logger.FileName)
def DeleteLog() -> None: """Delete log file.""" if os.path.exists(Logger.FileName): os.remove(Logger.FileName)
[ "Delete", "log", "file", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2890-L2893
[ "def", "DeleteLog", "(", ")", "->", "None", ":", "if", "os", ".", "path", ".", "exists", "(", "Logger", ".", "FileName", ")", ":", "os", ".", "remove", "(", "Logger", ".", "FileName", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
Bitmap.FromHandle
Capture a native window to Bitmap by its handle. hwnd: int, the handle of a native window. left: int. top: int. right: int. bottom: int. left, top, right and bottom are control's internal postion(from 0,0). Return bool, True if succeed otherwise False.
uiautomation/uiautomation.py
def FromHandle(self, hwnd: int, left: int = 0, top: int = 0, right: int = 0, bottom: int = 0) -> bool: """ Capture a native window to Bitmap by its handle. hwnd: int, the handle of a native window. left: int. top: int. right: int. bottom: int. left, top, r...
def FromHandle(self, hwnd: int, left: int = 0, top: int = 0, right: int = 0, bottom: int = 0) -> bool: """ Capture a native window to Bitmap by its handle. hwnd: int, the handle of a native window. left: int. top: int. right: int. bottom: int. left, top, r...
[ "Capture", "a", "native", "window", "to", "Bitmap", "by", "its", "handle", ".", "hwnd", ":", "int", "the", "handle", "of", "a", "native", "window", ".", "left", ":", "int", ".", "top", ":", "int", ".", "right", ":", "int", ".", "bottom", ":", "int"...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2941-L2959
[ "def", "FromHandle", "(", "self", ",", "hwnd", ":", "int", ",", "left", ":", "int", "=", "0", ",", "top", ":", "int", "=", "0", ",", "right", ":", "int", "=", "0", ",", "bottom", ":", "int", "=", "0", ")", "->", "bool", ":", "self", ".", "R...
2cc91060982cc8b777152e698d677cc2989bf263
valid
Bitmap.FromControl
Capture a control to Bitmap. control: `Control` or its subclass. x: int. y: int. width: int. height: int. x, y: the point in control's internal position(from 0,0) width, height: image's width and height from x, y, use 0 for entire area, If width(or height)...
uiautomation/uiautomation.py
def FromControl(self, control: 'Control', x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool: """ Capture a control to Bitmap. control: `Control` or its subclass. x: int. y: int. width: int. height: int. x, y: the point in control's internal ...
def FromControl(self, control: 'Control', x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool: """ Capture a control to Bitmap. control: `Control` or its subclass. x: int. y: int. width: int. height: int. x, y: the point in control's internal ...
[ "Capture", "a", "control", "to", "Bitmap", ".", "control", ":", "Control", "or", "its", "subclass", ".", "x", ":", "int", ".", "y", ":", "int", ".", "width", ":", "int", ".", "height", ":", "int", ".", "x", "y", ":", "the", "point", "in", "contro...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L2961-L3002
[ "def", "FromControl", "(", "self", ",", "control", ":", "'Control'", ",", "x", ":", "int", "=", "0", ",", "y", ":", "int", "=", "0", ",", "width", ":", "int", "=", "0", ",", "height", ":", "int", "=", "0", ")", "->", "bool", ":", "rect", "=",...
2cc91060982cc8b777152e698d677cc2989bf263
valid
Bitmap.FromFile
Load image from a file. filePath: str. Return bool, True if succeed otherwise False.
uiautomation/uiautomation.py
def FromFile(self, filePath: str) -> bool: """ Load image from a file. filePath: str. Return bool, True if succeed otherwise False. """ self.Release() self._bitmap = _DllClient.instance().dll.BitmapFromFile(ctypes.c_wchar_p(filePath)) self._getsize() ...
def FromFile(self, filePath: str) -> bool: """ Load image from a file. filePath: str. Return bool, True if succeed otherwise False. """ self.Release() self._bitmap = _DllClient.instance().dll.BitmapFromFile(ctypes.c_wchar_p(filePath)) self._getsize() ...
[ "Load", "image", "from", "a", "file", ".", "filePath", ":", "str", ".", "Return", "bool", "True", "if", "succeed", "otherwise", "False", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L3004-L3013
[ "def", "FromFile", "(", "self", ",", "filePath", ":", "str", ")", "->", "bool", ":", "self", ".", "Release", "(", ")", "self", ".", "_bitmap", "=", "_DllClient", ".", "instance", "(", ")", ".", "dll", ".", "BitmapFromFile", "(", "ctypes", ".", "c_wch...
2cc91060982cc8b777152e698d677cc2989bf263
valid
Bitmap.ToFile
Save to a file. savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff. Return bool, True if succeed otherwise False.
uiautomation/uiautomation.py
def ToFile(self, savePath: str) -> bool: """ Save to a file. savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff. Return bool, True if succeed otherwise False. """ name, ext = os.path.splitext(savePath) extMap = {'.bmp': 'image/bmp' ...
def ToFile(self, savePath: str) -> bool: """ Save to a file. savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff. Return bool, True if succeed otherwise False. """ name, ext = os.path.splitext(savePath) extMap = {'.bmp': 'image/bmp' ...
[ "Save", "to", "a", "file", ".", "savePath", ":", "str", "should", "end", "with", ".", "bmp", ".", "jpg", ".", "jpeg", ".", "png", ".", "gif", ".", "tif", ".", "tiff", ".", "Return", "bool", "True", "if", "succeed", "otherwise", "False", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L3015-L3031
[ "def", "ToFile", "(", "self", ",", "savePath", ":", "str", ")", "->", "bool", ":", "name", ",", "ext", "=", "os", ".", "path", ".", "splitext", "(", "savePath", ")", "extMap", "=", "{", "'.bmp'", ":", "'image/bmp'", ",", "'.jpg'", ":", "'image/jpeg'"...
2cc91060982cc8b777152e698d677cc2989bf263
valid
Bitmap.GetPixelColor
Get color value of a pixel. x: int. y: int. Return int, argb color. b = argb & 0x0000FF g = (argb & 0x00FF00) >> 8 r = (argb & 0xFF0000) >> 16 a = (argb & 0xFF0000) >> 24
uiautomation/uiautomation.py
def GetPixelColor(self, x: int, y: int) -> int: """ Get color value of a pixel. x: int. y: int. Return int, argb color. b = argb & 0x0000FF g = (argb & 0x00FF00) >> 8 r = (argb & 0xFF0000) >> 16 a = (argb & 0xFF0000) >> 24 """ retur...
def GetPixelColor(self, x: int, y: int) -> int: """ Get color value of a pixel. x: int. y: int. Return int, argb color. b = argb & 0x0000FF g = (argb & 0x00FF00) >> 8 r = (argb & 0xFF0000) >> 16 a = (argb & 0xFF0000) >> 24 """ retur...
[ "Get", "color", "value", "of", "a", "pixel", ".", "x", ":", "int", ".", "y", ":", "int", ".", "Return", "int", "argb", "color", ".", "b", "=", "argb", "&", "0x0000FF", "g", "=", "(", "argb", "&", "0x00FF00", ")", ">>", "8", "r", "=", "(", "ar...
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L3033-L3044
[ "def", "GetPixelColor", "(", "self", ",", "x", ":", "int", ",", "y", ":", "int", ")", "->", "int", ":", "return", "_DllClient", ".", "instance", "(", ")", ".", "dll", ".", "BitmapGetPixel", "(", "self", ".", "_bitmap", ",", "x", ",", "y", ")" ]
2cc91060982cc8b777152e698d677cc2989bf263
valid
Bitmap.SetPixelColor
Set color value of a pixel. x: int. y: int. argb: int, color value. Return bool, True if succeed otherwise False.
uiautomation/uiautomation.py
def SetPixelColor(self, x: int, y: int, argb: int) -> bool: """ Set color value of a pixel. x: int. y: int. argb: int, color value. Return bool, True if succeed otherwise False. """ return _DllClient.instance().dll.BitmapSetPixel(self._bitmap, x, y, argb)
def SetPixelColor(self, x: int, y: int, argb: int) -> bool: """ Set color value of a pixel. x: int. y: int. argb: int, color value. Return bool, True if succeed otherwise False. """ return _DllClient.instance().dll.BitmapSetPixel(self._bitmap, x, y, argb)
[ "Set", "color", "value", "of", "a", "pixel", ".", "x", ":", "int", ".", "y", ":", "int", ".", "argb", ":", "int", "color", "value", ".", "Return", "bool", "True", "if", "succeed", "otherwise", "False", "." ]
yinkaisheng/Python-UIAutomation-for-Windows
python
https://github.com/yinkaisheng/Python-UIAutomation-for-Windows/blob/2cc91060982cc8b777152e698d677cc2989bf263/uiautomation/uiautomation.py#L3046-L3054
[ "def", "SetPixelColor", "(", "self", ",", "x", ":", "int", ",", "y", ":", "int", ",", "argb", ":", "int", ")", "->", "bool", ":", "return", "_DllClient", ".", "instance", "(", ")", ".", "dll", ".", "BitmapSetPixel", "(", "self", ".", "_bitmap", ","...
2cc91060982cc8b777152e698d677cc2989bf263