API 函数 midiOutShortMsg() 和 Excel97 Windows 98您用过 API 函数 midiOutShortMsg() 吗?请问它能不能用在 Excel97 + Windows 98?如果你不知道,能不能帮我在Excel97 + Windows 98 (我没有)试试下面的VBA代码,听听有没有声音发出来。如果没有声音,请问在Excel97 + Windows 98 下用什么代码能发出给定的频率和长度的声音。Private Declare Function midiOutClose Lib "winmm.dll" (ByVal hMidiOut As Long) As LongPrivate Declare Function midiOutOpen Lib "winmm.dll" (lphMidiOut As Long, ByVal uDeviceID As Long, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal dwFlags As Long) As LongPrivate Declare Function midiOutShortMsg Lib "winmm.dll" (ByVal hMidiOut As Long, ByVal dwMsg As Long) As LongPrivate Sub Test()Dim hMidiOut As Long, i As LongmidiOutOpen hMidiOut, 0, 0, 0, 0 midiOutShortMsg hMidiOut, &HA00000 + &H3C00 + &H90 For i = 1 To 100000 DoEvents Next i midiOutClose hMidiOutEnd Sub

热心网友

这编的好象是个宏病毒代码,不要害人噢!!!