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 9226539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:51:23+00:00 2026-06-18T04:51:23+00:00

I want to focus a windows when it is blinking/flashing. The more common case

  • 0

I want to focus a windows when it is blinking/flashing. The more common case is when someone sends some text by a chat software (for example MSN). In this case the windows bar is going to start blink in the start bar. I don’t know if i am explaining myself. I want to get the HWND of the blinking windows. If more info is necesary to understand it, I will try to explain me better.

I have already searched info about this case but I find nothing. Maybe it can be resolver using “win32gui” library.

Thank you for your help!!!

  • 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-18T04:51:24+00:00Added an answer on June 18, 2026 at 4:51 am

    First, most programs flash their windows by calling FlashWindowEx (or some higher-level function that wraps it). But there are a few apps—mostly from Microsoft—that do some custom stuff instead that looks like window-flashing to the end user, but may not look the same under the covers. Hopefully, you don’t care about any such custom apps.

    Anyway, the easiest way to capture that information is to install a shell hook with SetWindowsHookEx or RegisterShellHookWindow. (You could instead explicitly inject code in front of user32.dll… but you don’t want to try that from Python.) When you do this, Windows will treat your window as if it were part of Explorer (the “shell”) and send it special messages about what other programs are doing—in particular, WM_SHELLHOOKMESSAGE.

    As forivall pointed out, this might be easier to do from AutoHotkey—this answer in the forums shows how to do it. It might also be easier to do from VB, or even C++. Yes, those languages are generally more difficult than Python, but the actual logic in your code is pretty trivial, and the only hard part is getting the shell hook messages, and that part will be easier in those languages. Another alternative is to use IronPython and do it via .NET.

    But you asked if it’s possible to do it from Python, and… yes, it is. I believe the relevant functions are not wrapped up by win32gui, so you’ll have to use ctypes to do it from Python. See this SO question for a possible example, and look at some of the Related questions on the side and the ctypes docs for other examples of using ctypes to call different functions out of user.dll.


    If you want to set a windows hook, the key function will look something like this (see ShellProc for details):

    HSHELL_REDRAW=6
    WM_SHELL=10
    
    def my_callback(nCode, wParam, lParam):
        if nCode == HSHELL_REDRAW and lParam:
            got_flashing_window_with_hwnd(wParam)
    
    hook = user32.SetWindowsHookEx(WM_SHELL, my_callback, None, 0)
    

    But you need to set the types and push the callback through ctypes.


    If you already have a window that you’re managing from Python, it’s probably easier to set yourself up as a shell hook window instead:

    user32.RegisterShellHookWindow(my_hwnd)
    

    Then, in your window proc:

    WM_SHELLHOOKMESSAGE = None
    def wndproc(hWnd, uMsg, lParam, wParam):
        if WM_SHELLHOOKMESSAGE is None:
            WM_SHELLHOOKMESSAGE = user32.RegisterWindowMessage('SHELLHOOK')
        if uMsg == WM_SHELLHOOKMESSAGE and wParam == HSHELL_FLASH:
            got_flashing_window_with_hwnd(lParam)
    

    I’m not sure whether you need elevated privileges for either of these, but I would suspect you do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to achieve this effect: When the user focus a text area within
I want to set a text in a specific label on focus of an
There were some windows opened, And from my process I want to launch one
I want to write a custom control (a text editor) for Windows Forms, which
I am adding a new blank row to a dojox.grid.DataGrid, and want to focus
I want to set focus on particular div using jquery or javascript. i have
I want to set focus on inputText field in JSF when there is a
i want to use focus function in jquery to return to same area of
When my Silverlight page loads, I want to set focus on a control. Simple
I want to handle the focus out Handler only to the component which 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.