def close_window_by_title(title):
try:
hwnd = win32gui.FindWindow(None, title)
win32gui.PostMessage(hwnd, win32con.WM_CLOSE, 0, 0)
except Exception as e:
print("Ошибка: ", e)
close_window_by_title('Название заголовка')
titles = []
def windowEnumerationHandler(hwnd, resultList):
if win32gui.IsWindowVisible(hwnd) and win32gui.GetWindowText(hwnd) != '':
resultList.append((hwnd, win32gui.GetWindowText(hwnd)))
win32gui.EnumWindows(windowEnumerationHandler, titles)
for i in titles:
print (i[1])
# Add one member to a group or channel
await app.add_chat_members(chat_id, user_id)
# Add multiple members to a group or channel
await app.add_chat_members(chat_id, [user_id1, user_id2, user_id3])
# Change forward_limit (for basic groups only)
await app.add_chat_members(chat_id, user_id, forward_limit=25)