⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 闪烁的标题栏 2.frm

📁 Windows API函数,希望大伙有用哦
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   1545
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3540
   LinkTopic       =   "Form1"
   ScaleHeight     =   1545
   ScaleWidth      =   3540
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "停止闪烁"
      Height          =   375
      Left            =   1770
      TabIndex        =   1
      Top             =   510
      Width           =   1365
   End
   Begin VB.CommandButton Command1 
      Caption         =   "闪   烁"
      Height          =   375
      Left            =   240
      TabIndex        =   0
      Top             =   510
      Width           =   1365
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'常数说明
Const FLASHW_STOP = &H0
Const FLASHW_CAPTION = &H1
Const FLASHW_TRAY = &H2
Const FLASHW_ALL = &H3
Const FLASHW_TIMER = &H4
'API函数说明
Private Declare Function FlashWindowEx Lib "user32" (pfwi As FLASHWINFO) As Boolean
'定义结构型变量
Private Type FLASHWINFO
    cbSize As Long
    hwnd As Long
    dwFlags As Long
    uCount As Long
    dwTimeout As Long
End Type
'声明FlashInfo为结构型变量
Dim FlashInfo As FLASHWINFO
Private Sub Command1_Click()
'使窗体图标闪烁
    FlashInfo.cbSize = Len(FlashInfo)
    FlashInfo.dwFlags = FLASHW_ALL Or FLASHW_TIMER
    FlashInfo.dwTimeout = 0
    FlashInfo.hwnd = Me.hwnd
    FlashInfo.uCount = 0
    FlashWindowEx FlashInfo
End Sub
Private Sub Command2_Click()
'停止图标闪烁
    FlashInfo.dwFlags = &H0
    FlashInfo.hwnd = Me.hwnd
    FlashWindowEx FlashInfo
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -