home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / PGUIDE / ATM / ATM.BAS next >
Encoding:
BASIC Source File  |  1996-09-16  |  1.7 KB  |  56 lines

  1. Attribute VB_Name = "modATM"
  2. ' Offset variable
  3. Public i As Integer
  4.  
  5. ' Currency conversion table from USD
  6. Public ConversionTable As Variant
  7.  
  8. ' High level sound support API
  9. #If Win32 Then
  10.     Declare Function sndPlaySound Lib "WINMM.DLL" Alias "sndPlaySoundA" _
  11.         (ByVal lpszSoundName As Any, ByVal uFlags As Long) As Long
  12. #Else
  13.     Declare Function sndPlaySound Lib "MMSYSTEM.DLL" _
  14.         (ByVal lpszSoundName As Any, ByVal wFlags As Integer) As Integer
  15. #End If
  16.  
  17. Global Const SND_ASYNC = &H1     ' Play asynchronously
  18. Global Const SND_NODEFAULT = &H2 ' Don't use default sound
  19. Global Const SND_MEMORY = &H4    ' lpszSoundName points to a memory file
  20.  
  21. Global SoundBuffer As String
  22.  
  23. ' Mousepointer over command button.
  24. Dim curSelect As StdPicture
  25.  
  26. Sub ConversionTable_Initialize()
  27.     ConversionTable = Array(1@, 4.8635@, 1.3978@, 1614@, 119.07@, 89.075@)
  28. End Sub
  29.  
  30. Sub BeginPlaySound(ByVal ResourceId As Integer)
  31.     Dim Ret As Variant
  32.     #If Win32 Then
  33.         ' Important: The returned string is converted to Unicode
  34.         SoundBuffer = StrConv(LoadResData(ResourceId, "ATM_SOUND"), vbUnicode)
  35.     #Else
  36.         SoundBuffer = LoadResData(ResourceId, "ATM_SOUND")
  37.     #End If
  38.     Ret = sndPlaySound(SoundBuffer, SND_ASYNC Or SND_NODEFAULT Or SND_MEMORY)
  39.     ' Important: This function is neccessary for playing sound asynchronously
  40.     DoEvents
  41. End Sub
  42.  
  43. Sub EndPlaySound()
  44.     Dim Ret As Variant
  45.     Ret = sndPlaySound(0&, 0&)
  46. End Sub
  47.  
  48. Sub Cursor_Initialize()
  49.     Set curSelect = LoadResPicture(1, vbResCursor)
  50. End Sub
  51.  
  52. Sub SetCursor(Button As CommandButton)
  53.     Button.MousePointer = 99
  54.     Button.MouseIcon = curSelect
  55. End Sub
  56.