chrome/updater/test/service/win/ui.py
def FindWindow(title, class_name, parent=0, child_after=0):
  """Finds a window of a given title and class.

  Args:
    title: Title of the window to search.
    class_name: Class name of the window to search.
    parent: Handle to the parent window whose child windows are to be searched.
    child_after: HWND to a child window. Search begins with the next child
      window in the Z order.

  Returns:
    Handle of the found window, or 0 if not found.
  """
  hwnd = 0
  try:
    hwnd = win32gui.FindWindowEx(
        int(parent), int(child_after), class_name, title)
  except win32gui.error as err:
    if err[0] == winrror.ERROR_INVALID_WINDOW_HANDLE:  # Could be closed.
      pass
    elif err[0] != winrror.ERROR_FILE_NOT_FOUND:
      raise err
  if hwnd:
    win32gui.FlashWindow(hwnd, True)
  return hwnd
Finds a window of a given title and class.

  Args:
    title: Title of the window to search.
    class_name: Class name of the window to search.
    parent: Handle to the parent window whose child windows are to be searched.
    child_after: HWND to a child window. Search begins with the next child
      window in the Z order.

  Returns:
    Handle of the found window, or 0 if not found.
  
Finds a window of a given title and class.
Finds a window of a given title and class .
def FindWindow(title, class_name, parent=0, child_after=0):
  hwnd = 0
  try:
    hwnd = win32gui.FindWindowEx(
        int(parent), int(child_after), class_name, title)
  except win32gui.error as err:
    if err[0] == winrror.ERROR_INVALID_WINDOW_HANDLE:  
      pass
    elif err[0] != winrror.ERROR_FILE_NOT_FOUND:
      raise err
  if hwnd:
    win32gui.FlashWindow(hwnd, True)
  return hwnd
def FindWindow ( title , class_name , parent = 0 , child_after = 0 ) : hwnd = 0 try : hwnd = win32gui . FindWindowEx ( int ( parent ) , int ( child_after ) , class_name , title ) except win32gui . error as err : if err [ 0 ] == winrror . ERROR_INVALID_WINDOW_HANDLE : pass elif err [ 0 ] != winrror . ERROR_FILE_NOT_FOUND : raise err if hwnd : win32gui . FlashWindow ( hwnd , True ) return hwnd
Finds a window of a given title and class.
Finds a window of a given title and class .
"""Finds a window of a given title and class.

  Args:
    title: Title of the window to search.
    class_name: Class name of the window to search.
    parent: Handle to the parent window whose child windows are to be searched.
    child_after: HWND to a child window. Search begins with the next child
      window in the Z order.

  Returns:
    Handle of the found window, or 0 if not found.
  """ # Could be closed.
Handle of the found window, or 0 if not found.
Handle of the found window or 0 if not found .
title
Title of the window to search.
Title of the window to search .
class_name
Class name of the window to search.
Class name of the window to search .
parent
Handle to the parent window whose child windows are to be searched.
Handle to the parent window whose child windows are to be searched .
child_after
HWND to a child window. Search begins with the next child
window in the Z order.
HWND to a child window . Search begins with the next child window in the Z order .