模拟电子钟 带语音报时功能
( 2 ) play
语法形式: play 设备名称 参数
功能: 播放动画文件
说明: play 命令的参数有 [ 1 ] From position1 to position2 : 指定的开始位置播放到指定的结束位置; [ 2 ] Fullscreen : 以全屏幕的方式播放动画文件; [ 3 ] Windows : 在默认的窗口中播放动画文件.
(3) cue
语法形式: cue 设备名称 参数
功能: 准备实例供播放使用
说明: cue命令参数有 [ 1 ] output : 准备一个实例供播放使用; [ 2 ] to position : 跳到指定位置,并且处于暂停状态.
下面是修改后的源代码:
Public Type SYSTEMTIME wYear As Integer wMonth As Integer
wDayOfWeek As Integer
wDay As Integer wHour As Integer wMinute As Integer wSecond As Integer
wMilliseconds As Integer
End Type
Public Declare Sub GetLocalTime Lib " kernel32 " Alias " GetLocalTime " ( lpSystemTime As SYSTEMTIME )
Public Declare Function mciSendCommand Lib " winmm.dll " Alias " mciSendCommandA " ( ByVal wDeviceID As Long , ByVal uMessage As Long , ByVal dwParam1 As Long , ByVal dwParam2 As Any ) As Long
Public Declare Function mciSendString Lib " winmm.dll " Alias " mciSendStringA " ( ByVal lpstrCommand As String , ByVal lpstrReturnString As String , ByVal uReturnLength As Long , ByVal hwndCallback As Long ) As Long
Dim dangqianshijian AS SYSTEMTIME
‘ = = = = = = = = = = = = = = = = = = = = = = = =
‘ 每秒钟触发一次此事件,从而获取当时的时间,并调用相应的函数,画出三个针的位置 ‘ = = = = = = = = = = = = = = = = = = = = = = = = Private Sub Timer1 _ Timer ( )