¼Ù Éè ×Ê Ô´ ÎÄ ¼þ ÊÇ Õâ Ñù µÄ £º 
     CHIMES WAVE DISCARDABLE "Chimes.wav" 
     DING WAVE DISCARDABLE "Ding.wav" 
    1¡¢ ½¨ Á¢ Ò» ¸ö ÐÂ ¹¤ ³Ì £» 
    2¡¢ Ìí ¼Ó ÏÂ Ãæ ´ú Âë µ½ Form1 
     '************************************************** 
     ' Form1.frm - µ÷ ÓÃ PlayWaveRes²¥ ·Å Éù Òô ×Ê Ô´ ÎÄ ¼þ 
     '************************************************** 
     Sub Command1_Click() 
     PlayWaveRes "Chimes" 
     PlayWaveRes "Ding" 
     End Sub 
    3¡¢ Ìí ¼Ó Äã µÄ ×Ê Ô´ ÎÄ ¼þ µ½ ¹¤ ³Ì ¡£ 
    4¡¢ ½¨ Á¢ Ò» ¸ö ÐÂ Ä£ ¿é £¬ Êä Èë ÒÔ ÏÂ ´ú Âë £º 
     '************************************************** 
     
     ' Baswave.bas - Ê¹ ÓÃ LoadResData²¥ ·Å Éù Òô ÎÄ ¼þ 
     '************************************************** 
     
     Option Explicit 
     Private Declare Function sndPlaySound Lib "winmm" Alias _ 
     "sndPlaySoundA" (lpszSoundName As Any, ByVal uFlags As Long) _ 
     As Long 
     
     '************************************************** 
     ' wFlags ²Î Êý 
     '************************************************** 
     
     Public Const SND_SYNC = &H0 ' Play synchronously (default). 
     'Public Const SND_ASYNC = &H1 ' Play asynchronously (see 
     ' note below). 
     Public Const SND_NODEFAULT = &H2 ' Do not use default sound. 
     Public Const SND_MEMORY = &H4 ' lpszSoundName points to a 
     ' memory file. 
     Public Const SND_LOOP = &H8 ' Loop the sound until next 
     ' sndPlaySound. 
     Public Const SND_NOSTOP = &H10 ' Do not stop any currently 
     ' playing sound. 
     
     '************************************************** 
     ' ²¥ ·Å ×Ê Ô´ ÎÄ ¼þ ÖÐ µÄ Éù Òô 
     '************************************************** 
     
     Public Sub PlayWaveRes(vntResourceID As Variant, Optional vntFlags) 
     '---------------------------------------------------------- 
     ' ×¢ Òâ : Èç ¹û Ê¹ ÓÃ SND_ASYNC£¬ Äã ±Ø Ðë ½« ÏÂ Ãæ µÄ 
     ' bytSound()Êý ×é ·Å ÔÚ Ä£ ¿é ¼¶ ±ä Á¿ ¶¨ Òå µÄ µØ ·½ 
     ' »ò ¶¨ Òå Îª ¾² Ì¬ ±ä Á¿ £¬ ·ñ Ôò ¿É ÄÜ µ¼ ÖÂ GPF 
     '------------------------------------------------- 
     Dim bytSound() As Byte ' Always store binary data in byte arrays! 
     
     bytSound = LoadResData(vntResourceID, "WAVE") 
     
     If IsMissing(vntFlags) Then 
     vntFlags = SND_NODEFAULT Or SND_SYNC Or SND_MEMORY 
     End If 
     
     If (vntFlags And SND_MEMORY) = 0 Then 
     vntFlags = vntFlags Or SND_MEMORY 
     End If 
     
     sndPlaySound bytSound(0), vntFlags 
     End Sub 
<END>    