Windows module for dost.This module contains functions that are specific to Windows.
Examples:
>>> from dost import windows
>>> windows.show_desktop()
>>> windows.get_active_window()
'Notepad'
>>> windows.get_all_opened_window_titles()
['Notepad', 'Program Manager', 'Desktop']
>>> windows.maximize_window(window_name='Notepad')
>>> windows.minimize_window(window_name='Notepad')
>>> windows.close_window(window_name='Notepad')
>>> windows.launch_app(path='Notepad')
The module contains the following functions:
show_desktop(): Show the desktop.
get_active_window(): Get the active window.
get_all_opened_window_titles(): Get all opened windows.
maximize_window(window_name): Maximize a window.
minimize_window(window_name): Minimize a window.
close_window(window_name): Close a window.
launch_app(path): Launch any windows application by its path or name.
activate_window(window_name)
Activate window
Parameters:
| Name |
Type |
Description |
Default |
window_name |
str
|
Window title |
required
|
Examples:
>>> windows.activate_window(window_name='Notepad')
close_window(window_name)
Closes the window
Parameters:
| Name |
Type |
Description |
Default |
window_name |
str
|
Window name |
required
|
Examples:
>>> windows.close_window(window_name='Notepad')
get_active_window()
Get active window
Returns:
| Name | Type |
Description |
str |
str
|
Active window |
Examples:
>>> windows.get_active_window()
get_all_opened_window_titles()
Get all opened titles windows
Returns:
| Type |
Description |
str || list
|
All opened titles windows |
Examples:
>>> windows.get_all_opened_window_titles()
launch_app(path)
Launch any exe/bat application
Parameters:
| Name |
Type |
Description |
Default |
path |
str || WindowsPath
|
Path to exe/bat application or application name |
required
|
Raises:
| Type |
Description |
FileNotFoundError
|
If path is not found |
ValueError
|
If path is empty |
Examples:
>>> windows.launch_app(path=notepad)
maximize_window(window_name)
Maximize windows
Parameters:
| Name |
Type |
Description |
Default |
window_name |
str
|
Window name. |
required
|
Examples:
>>> windows.maximize_window()
minimize_window(window_name)
Minimize windows
Parameters:
| Name |
Type |
Description |
Default |
window_name |
str
|
Window name |
required
|
Examples:
>>> windows.minimize_window(window_name='Notepad')
show_desktop()
Minimize all windows and show the desktop.
Examples:
>>> windows.show_desktop()