建立新的项目文件,添加模块文件,并填写如下代码:
Public Declare Function FlashWindow _
Lib "user32" (ByVal hwnd As Long, _
ByVal bInvert As Long) As Long
在窗体中添加两个按钮和一个计时器,并用设置以下属性:
command1.caption="开始"
command2.caption="停止"
timer1.interval=500 '每0.5秒闪烁一次
timer1.enabled=false
Private Sub Timer1_Timer()
a& = FlashWindow(Me.hwnd, 1)
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
End Sub