Python win32con.FLASHW公司_*旗帜

2024-04-28 00:14:17 发布

您现在位置:Python中文网/ 问答频道 /正文

国庆节,
在他的链接http://docs.activestate.com/activepython/2.7/pywin32/win32gui__FlashWindowEx_meth.html有win32的文档gui.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

但是在Windows7任务栏上出现的只是图标有金色的背景,而不是闪烁,所以我的问题是,有人知道win32吗con.FLASHW公司_*文件中提到的标志,也许是指向更多信息的链接?
干杯


Tags: the文档comhttpdocs链接htmlgui
2条回答

有关FlashWindowEx函数的Visual Basic版本的更多信息,请访问"How to use FlashWindowEx to Notify a User from Visual Basic"Microsoft的支持部门。在

该页面包含FLASHW_*标志的列表。在

参考: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)

相关问题 更多 >