Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8247175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:45:18+00:00 2026-06-07T22:45:18+00:00

I am new to python and I am trying to write a script that

  • 0

I am new to python and I am trying to write a script that exits out of a loop when a certain window closes. I am having problems getting the code to work properly it won’t even enter the loop. I think this is because I am not properly getting the window name. I was wondering if there are any good tutorials on the Win32Gui extension that would help me to understand how it works.

Edit

Here is what I have, it is doing what it is suppose to do, but I am sure there is an easier way of doing it.

def answerCalls(local, network):
t = 0
count = 0
while t == 0:
    time.sleep(1)
    if win32gui.GetWindowText(win32gui.GetForegroundWindow()) == "Incoming Call":
        time.sleep(10)   
        getApplicationPos("Incoming Call")
        clickOnElement(******.IncomingCall_AnswerButton())
        time.sleep(10)
        if win32gui.GetWindowText(win32gui.GetForegroundWindow()) == "Video Call":
            count += 1
            writeFile("Answering Calls", count, local)
            uploadToServer(local, network)  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T22:45:20+00:00Added an answer on June 7, 2026 at 10:45 pm

    The following example (Python 3) gets a list of the titles of all the windows:

    import win32gui
    
    def enum_window_titles():
        def callback(handle, data):
            titles.append(win32gui.GetWindowText(handle))
    
        titles = []
        win32gui.EnumWindows(callback, None)
        return titles
    
    titles = enum_window_titles()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm new to python , and trying to write a script in order to
I am very new to python. I am trying to write a program that
I am quite new in python and trying to write a script to login
I'm very new to Python and trying to write a program that parses some
I'm brand new at Python and I'm trying to write an extension to an
I am very new to Python, and trying to figure out how to create
I am trying to write a pre-commit hook script that will alter a specific
I'm trying to write (what I thought would be) a simple bash script that
I am trying to write a long string in Python that gets displayed as
I am new to python (and this site); I am trying to write a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.