Find the first top-level window in the current desktop to match the given class name and/or window name. If neither are provided any top-level window will match. @see: L{get_window_at} @type className: str @param className: (Optional) Class name of
(className=None, windowName=None)
| 133 | |
| 134 | @staticmethod |
| 135 | def find_window(className=None, windowName=None): |
| 136 | """ |
| 137 | Find the first top-level window in the current desktop to match the |
| 138 | given class name and/or window name. If neither are provided any |
| 139 | top-level window will match. |
| 140 | |
| 141 | @see: L{get_window_at} |
| 142 | |
| 143 | @type className: str |
| 144 | @param className: (Optional) Class name of the window to find. |
| 145 | If C{None} or not used any class name will match the search. |
| 146 | |
| 147 | @type windowName: str |
| 148 | @param windowName: (Optional) Caption text of the window to find. |
| 149 | If C{None} or not used any caption text will match the search. |
| 150 | |
| 151 | @rtype: L{Window} or None |
| 152 | @return: A window that matches the request. There may be more matching |
| 153 | windows, but this method only returns one. If no matching window |
| 154 | is found, the return value is C{None}. |
| 155 | |
| 156 | @raise WindowsError: An error occured while processing this request. |
| 157 | """ |
| 158 | # I'd love to reverse the order of the parameters |
| 159 | # but that might create some confusion. :( |
| 160 | hWnd = win32.FindWindow(className, windowName) |
| 161 | if hWnd: |
| 162 | return Window(hWnd) |
| 163 | |
| 164 | @staticmethod |
| 165 | def get_window_at(x, y): |