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

  • Home
  • SEARCH
  • 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 7801827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:03:57+00:00 2026-06-02T01:03:57+00:00

with python, I want to get a window title,a stock software window. the window’s

  • 0

with python, I want to get a window title,a stock software window.

the window’s title will change when I browse another stock ,now I want to scan it every 100ms and return the new title,but the front text in the window title is the same text.

I can print the title in cmd,but I don’t know how to scan it every 100ms and return

I use this code:

from win32gui import *
import re

titles = set() 
titlekey = ''

def foo(hwnd,nouse):
    if IsWindow(hwnd) and IsWindowEnabled(hwnd) and IsWindowVisible(hwnd):
        titles.add(GetWindowText(hwnd))

EnumWindows(foo, 0) 
lt = [t for t in titles if t] 
lt.sort() 
for t in lt:
    if re.match(titlekey,t):
        print t

How to scan every 100ms and return the new title when it change?

  • 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-02T01:03:58+00:00Added an answer on June 2, 2026 at 1:03 am

    Put it in a loop:

    import win32gui
    tempWindowName=win32gui.GetWindowText (win32gui.GetForegroundWindow())
    import time
    while True:
        if (tempWindowName==win32gui.GetWindowText (win32gui.GetForegroundWindow()))
            pass
        else
            tempWindowName=win32gui.GetWindowText (win32gui.GetForegroundWindow())
            #do what you want
        time.sleep(0.1)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to get a field in SQL server 2008 from python 2.6. Here
In Python, if I want to get the first n characters of a string
I want to execute some Python code, typed at runtime, so I get the
How do I get a list of all python modules available? I don't want
Given: alphabet = ['a','b','c',...,'z'] i want python to enumerate every combination (starting from 1
The title says it mostly. If I have an object in Python and want
Possible Duplicate: What IDE to use for Python? I want to get serious with
I have installed Python 2.7 for Windows, and downloaded Django-1.2.3. Now, I want to
How can I get cpuinfo in python 2.4. I want to determine number of
I want to display my calculated output in a Gui window in python. I

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.