1

G'day,
在他的链接http://docs.activestate.com/activepython/2.7/pywin32/win32gui__FlashWindowEx_meth.html有 win32gui.FlashWindowEx() 的文档,我已经设法使用

import win32gui as w
a = w.GetForegroundWindow() #just get the handler/ID for the current window
w.FlashWindowEx(a,0,5,1000) #many variations of the 5,1000 have been tried

但在 Windows 7 任务栏中发生的所有事情都是图标获得金色背景,而不是闪烁,所以我的问题是,有没有人知道文档提到的 win32con.FLASHW_* 标志,也许是有关它们的更多信息的链接?
干杯

4

2 回答 2

1

在“如何使用 FlashWindowEx 从 Visual Basic 通知用户”中FlashWindowEx提供了有关该函数的 Visual Basic 版本的更多信息。

该页面包括FLASHW_*标志列表。

于 2011-11-28T06:11:59.400 回答
1

参考: http: //guangboo.org/2013/05/14/wxpython-flashwindow-using-win32api

from ctypes import *
import win32con 
import win32gui as w
cur_window = w.GetForegroundWindow() #just get the handler/ID for the current window

class FLASHWINFO(Structure):
        _fields_ = [('cbSize', c_uint),
                ('hwnd', c_uint),
                ('dwFlags', c_uint),
                ('uCount', c_uint),
                ('dwTimeout', c_uint)]

def flash(hwnd):
        '''Flash a window with caption and tray.'''
        info = FLASHWINFO(0, hwnd, win32con.FLASHW_ALL | win32con.FLASHW_TIMERNOFG, 0, 0)
        info.cbSize = sizeof(info)
        FlashWindowEx(byref(info))

flash(cur_window)
于 2014-02-12T17:37:40.600 回答