當前位置: 首頁>>代碼示例>>Python>>正文


Python win32gui.FindWindowEx方法代碼示例

本文整理匯總了Python中win32gui.FindWindowEx方法的典型用法代碼示例。如果您正苦於以下問題:Python win32gui.FindWindowEx方法的具體用法?Python win32gui.FindWindowEx怎麽用?Python win32gui.FindWindowEx使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在win32gui的用法示例。


在下文中一共展示了win32gui.FindWindowEx方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: dumpWindow

# 需要導入模塊: import win32gui [as 別名]
# 或者: from win32gui import FindWindowEx [as 別名]
def dumpWindow(hwnd, wantedText=None, wantedClass=None):
    '''
    :param hwnd: 窗口句柄
    :param wantedText: 指定子窗口名
    :param wantedClass: 指定子窗口類名
    :return: 返回父窗口下所有子窗體的句柄
    '''
    windows = []
    hwndChild = None
    while True:
        hwndChild = win32gui.FindWindowEx(hwnd, hwndChild, wantedClass, wantedText)
        if hwndChild:
            textName = win32gui.GetWindowText(hwndChild)
            className = win32gui.GetClassName(hwndChild)
            windows.append((hwndChild, textName, className))
        else:
            return windows 
開發者ID:ynzheng,項目名稱:pyautotrade_tdx,代碼行數:19,代碼來源:winguiauto.py

示例2: TestObjectFromWindow

# 需要導入模塊: import win32gui [as 別名]
# 或者: from win32gui import FindWindowEx [as 別名]
def TestObjectFromWindow():
    # Check we can use ObjectFromLresult to get the COM object from the
    # HWND - see KB Q249232
    # Locating the HWND is different than the KB says...
    hwnd = win32gui.FindWindow('IEFrame', None)
    for child_class in ['TabWindowClass', 'Shell DocObject View',
                        'Internet Explorer_Server']:
        hwnd = win32gui.FindWindowEx(hwnd, 0, child_class, None)
        assert hwnd, "Couldn't find '%s'" % (child_class,)
    # But here is the point - once you have an 'Internet Explorer_Server',
    # you can send a message and use ObjectFromLresult to get it back.
    msg = win32gui.RegisterWindowMessage("WM_HTML_GETOBJECT")
    rc, result = win32gui.SendMessageTimeout(hwnd, msg, 0, 0, win32con.SMTO_ABORTIFHUNG, 1000)
    ob = pythoncom.ObjectFromLresult(result, pythoncom.IID_IDispatch, 0)
    doc = Dispatch(ob)
    # just to prove it works, set the background color of the document.
    for color in "red green blue orange white".split():
        doc.bgColor = color
        time.sleep(0.2) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:21,代碼來源:testExplorer.py

示例3: dumpSpecifiedWindow

# 需要導入模塊: import win32gui [as 別名]
# 或者: from win32gui import FindWindowEx [as 別名]
def dumpSpecifiedWindow(hwnd, wantedText=None, wantedClass=None):
    '''
    :param hwnd: 父窗口句柄
    :param wantedText: 指定子窗口名
    :param wantedClass: 指定子窗口類名
    :return: 返回父窗口下所有子窗體的句柄
    '''
    windows = []
    hwndChild = win32gui.FindWindowEx(hwnd, None, wantedClass, wantedText)
    windows.append(hwndChild)
    while True:
        hwndChild = win32gui.FindWindowEx(hwnd, hwndChild, wantedClass, wantedText)
        if hwndChild:
            windows.append(hwndChild)
        else:
            return windows 
開發者ID:bluestinger,項目名稱:PyAutoTrading,代碼行數:18,代碼來源:winguiauto.py

示例4: dumpSpecifiedWindow

# 需要導入模塊: import win32gui [as 別名]
# 或者: from win32gui import FindWindowEx [as 別名]
def dumpSpecifiedWindow(hwnd, wantedText=None, wantedClass=None):
    '''
    :param hwnd: 父窗口句柄
    :param wantedText: 指定子窗口名
    :param wantedClass: 指定子窗口類名
    :return: 返回父窗口下所有子窗體的句柄
    '''
    windows = []
    hwndChild = None
    while True:
        hwndChild = win32gui.FindWindowEx(hwnd, hwndChild, wantedClass, wantedText)
        if hwndChild:
            textName = win32gui.GetWindowText(hwndChild)
            className = win32gui.GetClassName(hwndChild)
            windows.append((hwndChild, textName, className))
        else:
            return windows 
開發者ID:wangdkchina,項目名稱:pyautotrade_tdx,代碼行數:19,代碼來源:winguiauto.py

示例5: dumpWindow

# 需要導入模塊: import win32gui [as 別名]
# 或者: from win32gui import FindWindowEx [as 別名]
def dumpWindow(hwnd, wantedText=None, wantedClass=None):
    """
    :param hwnd: 窗口句柄
    :param wantedText: 指定子窗口名
    :param wantedClass: 指定子窗口類名
    :return: 返回父窗口下所有子窗體的句柄
    """
    windows = []
    hwndChild = None
    while True:
        hwndChild = win32gui.FindWindowEx(hwnd, hwndChild, wantedClass, wantedText)
        if hwndChild:
            textName = win32gui.GetWindowText(hwndChild)
            className = win32gui.GetClassName(hwndChild)
            windows.append((hwndChild, textName, className))
        else:
            return windows 
開發者ID:drongh,項目名稱:pyAutoTrading,代碼行數:19,代碼來源:winguiauto.py

示例6: find_traywindow_hwnd

# 需要導入模塊: import win32gui [as 別名]
# 或者: from win32gui import FindWindowEx [as 別名]
def find_traywindow_hwnd():
    global _hwnd
    if _hwnd is None:
        try:
            _hwnd = win32gui.FindWindowEx(0, 0, 'wxWindowClassNR', '')
        except:
            pass
    return _hwnd 
開發者ID:kenorb-contrib,項目名稱:BitTorrent,代碼行數:10,代碼來源:ToolTip.py


注:本文中的win32gui.FindWindowEx方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。