Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimizing Browser Window #341

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
9 changes: 9 additions & 0 deletions wplay/terminal_chat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# region IMPORTS
from pathlib import Path
import win32gui, win32con

from wplay.utils import browser_config
from wplay.utils import target_search
Expand All @@ -18,6 +19,7 @@


async def chat(target):
initial_minimize = True
__logger.info("Chatting with target")
page, _ = await browser_config.configure_browser_and_load_whatsapp()

Expand All @@ -34,6 +36,13 @@ async def chat(target):
print("\033[91m {}\033[00m".format("\nType '...' in a new line or alone in the message to change target person.\nType '#_FILE' to send Image/Video/Documentd etc.\n"))

while True:
#Minimizing the Window after Target Select
if (initial_minimize==True):
print("Browser Minimized")
Minimize = win32gui.GetForegroundWindow()
win32gui.ShowWindow(Minimize, win32con.SW_MINIMIZE)
initial_minimize = False

await getMessages(page, target)
message: list[str] = io.ask_user_for_message_breakline_mode()

Expand Down