Exemplo n.º 1
0
def run_as_wait(user,
                domain,
                password,
                filename,
                logon_flag=1,
                work_dir="",
                show_flag=Properties.SW_SHOWNORMAL):
    """
    Runs an external program.
    :param user: username The user name to use.
    :param domain: The domain name to use.
    :param password: The password to use.
    :param logon_flag: 0 = do not load the user profile, 1 = (default) load
        the user profile, 2 = use for net credentials only
    :param filename: The name of the executable (EXE, BAT, COM, or PIF) to run.
    :param work_dir: The working directory.
    :param show_flag: The "show" flag of the executed program:
        SW_HIDE = Hidden window
        SW_MINIMIZE = Minimized window
        SW_MAXIMIZE = Maximized window
    :return:
    """
    ret = AUTO_IT.AU3_RunAsWait(LPCWSTR(user), LPCWSTR(domain),
                                LPCWSTR(password), INT(logon_flag),
                                LPCWSTR(filename), LPCWSTR(work_dir),
                                INT(show_flag))
    return ret
Exemplo n.º 2
0
def win_get_state_by_handle(handle):
    """

    :param handle:
    :return:
    """
    res = AUTO_IT.AU3_WinGetStateByHandle(HWND(handle))
    return res
Exemplo n.º 3
0
def win_get_process_by_handle(handle):
    """

    :param handle:
    :return:
    """
    res = AUTO_IT.AU3_WinGetProcessByHandle(HWND(handle))
    return res
Exemplo n.º 4
0
def win_kill_by_handle(handle):
    """

    :param handle:
    :return:
    """
    ret = AUTO_IT.AU3_WinKillByHandle(HWND(handle))
    return ret
Exemplo n.º 5
0
def win_close_by_handle(handle):
    """

    :param handle:
    :return:
    """
    ret = AUTO_IT.AU3_WinCloseByHandle(HWND(handle))
    return ret
Exemplo n.º 6
0
def win_exists_by_handle(handle):
    """

    :param handle:
    :return:
    """
    ret = AUTO_IT.AU3_WinExistsByHandle(HWND(handle))
    return ret
Exemplo n.º 7
0
def win_get_caret_pos():
    """
    Returns the coordinates of the caret in the foreground window
    :return:
    """
    p = POINT()
    AUTO_IT.AU3_WinGetCaretPos(byref(p))
    return p.x, p.y
Exemplo n.º 8
0
def process_exists(process):
    """

    :param process:
    :return:
    """
    ret = AUTO_IT.AU3_ProcessExists(LPCWSTR(process))
    return ret
Exemplo n.º 9
0
def win_active_by_handle(handle):
    """

    :param handle:
    :return:
    """
    ret = AUTO_IT.AU3_WinActiveByHandle(HWND(handle))
    return ret
Exemplo n.º 10
0
def control_show_by_handle(hwnd, h_ctrl):
    """

    :param hwnd:
    :param h_ctrl:
    :return:
    """
    ret = AUTO_IT.AU3_ControlShowByHandle(HWND(hwnd), HWND(h_ctrl))
    return ret
Exemplo n.º 11
0
def win_get_text_by_handle(handle, buf_size=256):
    """

    :param handle:
    :return:
    """
    ret_text = create_unicode_buffer(buf_size)
    AUTO_IT.AU3_WinGetTextByHandle(HWND(handle), ret_text, INT(buf_size))
    return ret_text.value.rstrip()
Exemplo n.º 12
0
def process_wait_close(process, timeout=0):
    """
    Pauses script execution until a given process does not exist.
    :param process:
    :param timeout:
    :return:
    """
    ret = AUTO_IT.AU3_ProcessWaitClose(LPCWSTR(process), INT(timeout))
    return ret
Exemplo n.º 13
0
def win_set_trans_by_handle(handle, trans):
    """

    :param handle:
    :param trans:
    :return:
    """
    ret = AUTO_IT.AU3_WinSetTransByHandle(HWND(handle), INT(trans))
    return ret
Exemplo n.º 14
0
def win_wait_not_active_by_handle(handle, timeout):
    """

    :param handle:
    :param timeout:
    :return:
    """
    ret = AUTO_IT.AU3_WinWaitNotActiveByHandle(HWND(handle), INT(timeout))
    return ret
Exemplo n.º 15
0
def win_set_title_by_handle(handle, new_title):
    """

    :param handle:
    :param new_title:
    :return:
    """
    ret = AUTO_IT.AU3_WinSetTitleByHandle(HWND(handle), LPCWSTR(new_title))
    return ret
Exemplo n.º 16
0
def win_set_state_by_handle(handle, flag=properties.SW_SHOW):
    """

    :param handle:
    :param flag:
    :return:
    """
    ret = AUTO_IT.AU3_WinSetStateByHandle(HWND(handle), INT(flag))
    return ret
Exemplo n.º 17
0
def control_get_handle(hwnd, control):
    """

    :param hwnd:
    :param control:
    :return:
    """
    ret = AUTO_IT.AU3_ControlGetHandle(HWND(hwnd), LPCWSTR(control))
    return ret
Exemplo n.º 18
0
def win_set_on_top_by_handle(handle, flag=1):
    """

    :param handle:
    :param flag:
    :return:
    """
    ret = AUTO_IT.AU3_WinSetOnTopByHandle(HWND(handle), INT(flag))
    return ret
Exemplo n.º 19
0
def control_enable_by_handle(hwnd, h_ctrl):
    """

    :param hwnd:
    :param h_ctrl:
    :return:
    """
    ret = AUTO_IT.AU3_ControlEnableByHandle(HWND(hwnd), HWND(h_ctrl))
    return ret
Exemplo n.º 20
0
def win_close(title, **kwargs):
    """

    :param title:
    :param text:
    :return:
    """
    text = kwargs.get("text", "")
    ret = AUTO_IT.AU3_WinClose(LPCWSTR(title), LPCWSTR(text))
    return ret
Exemplo n.º 21
0
def win_get_process(title, **kwargs):
    """

    :param title:
    :param text:
    :return:
    """
    text = kwargs.get("text", "")
    res = AUTO_IT.AU3_WinGetProcess(LPCWSTR(title), LPCWSTR(text))
    return res
Exemplo n.º 22
0
def run(filename, work_dir="", show_flag=Properties.SW_SHOWNORMAL):
    """

    :param filename:
    :param work_dir:
    :param show_flag:
    :return:
    """
    ret = AUTO_IT.AU3_Run(LPCWSTR(filename), LPCWSTR(work_dir), INT(show_flag))
    return ret
Exemplo n.º 23
0
def win_activate(title, **kwargs):
    """
    Activates (gives focus to) a window.
    :param title:
    :param text:
    :return:
    """
    text = kwargs.get("text", "")
    ret = AUTO_IT.AU3_WinActivate(LPCWSTR(title), LPCWSTR(text))
    return ret
Exemplo n.º 24
0
def win_exists(title, **kwargs):
    """
    Checks to see if a specified window exists.
    :param title: The title of the window to check.
    :param text: The text of the window to check.
    :return: Returns 1 if the window exists, otherwise returns 0.
    """
    text = kwargs.get("text", "")
    ret = AUTO_IT.AU3_WinExists(LPCWSTR(title), LPCWSTR(text))
    return ret
Exemplo n.º 25
0
def win_wait_close(title, timeout=0, **kwargs):
    """

    :param title:
    :param timeout:
    :param kwargs:
    :return:
    """
    text = kwargs.get("text", "")
    ret = AUTO_IT.AU3_WinWaitClose(LPCWSTR(title), LPCWSTR(text), INT(timeout))
    return ret
Exemplo n.º 26
0
def control_set_text_by_handle(hwnd, h_ctrl, control_text):
    """

    :param hwnd:
    :param h_ctrl:
    :param control_text:
    :return:
    """
    ret = AUTO_IT.AU3_ControlSetTextByHandle(HWND(hwnd), HWND(h_ctrl),
                                             LPCWSTR(control_text))
    return ret
Exemplo n.º 27
0
def win_get_client_size_by_handle(handle):
    """

    :param handle:
    :return:
    """
    rect = RECT()
    ret = AUTO_IT.AU3_WinGetClientSizeByHandle(HWND(handle), byref(rect))
    if ret == 1:
        raise AutoItError("get the size of client failed")
    return rect.right, rect.bottom
Exemplo n.º 28
0
def win_get_pos_by_handle(handle):
    """

    :param handle:
    :return:
    """
    rect = RECT()
    res = AUTO_IT.AU3_WinGetPosByHandle(HWND(handle), byref(rect))
    if res == 1:
        raise AutoItError("No window match the handle: %s" % str(handle))
    return rect.left, rect.top, rect.right, rect.bottom
Exemplo n.º 29
0
def win_set_title(title, new_title, **kwargs):
    """

    :param title:
    :param new_title:
    :param kwargs:
    :return:
    """
    text = kwargs.get("text", "")
    ret = AUTO_IT.AU3_WinSetTitle(LPCWSTR(title), LPCWSTR(text),
                                  LPCWSTR(new_title))
    return ret
Exemplo n.º 30
0
def win_set_on_top(title, flag=1, **kwargs):
    """

    :param title:
    :param flag: 1=set on top flag, 0 = remove on top flag
    :param kwargs:
    :return:
    """
    text = kwargs.get("text", "")

    ret = AUTO_IT.AU3_WinSetOnTop(LPCWSTR(title), LPCWSTR(text), INT(flag))
    return ret