Index: Include/api_mmsys.sbp
===================================================================
--- Include/api_mmsys.sbp	(revision 76)
+++ Include/api_mmsys.sbp	(revision 95)
@@ -84,8 +84,4 @@
 
 Const MM_MCINOTIFY =      &H3B9			'MCI
-Const MCI_NOTIFY_SUCCESSFUL =         &H0001
-Const MCI_NOTIFY_SUPERSEDED =         &H0002
-Const MCI_NOTIFY_ABORTED =            &H0004
-Const MCI_NOTIFY_FAILURE =            &H0008
 
 Const MM_WOM_OPEN =       &H3BB			'waveform output
@@ -1385,199 +1381,136 @@
 ' MCI support
 
-'--------------------------------------------------------
-' Time Format(used in MCI_SET_PARAMS, MCI_STATUS_PARAMS)
-
-Const MCI_FORMAT_MILLISECONDS =       0
-Const MCI_FORMAT_HMS =                1
-Const MCI_FORMAT_MSF =                2
-Const MCI_FORMAT_FRAMES =             3
-Const MCI_FORMAT_SMPTE_24 =           4
-Const MCI_FORMAT_SMPTE_25 =           5
-Const MCI_FORMAT_SMPTE_30 =           6
-Const MCI_FORMAT_SMPTE_30DROP =       7
-Const MCI_FORMAT_BYTES =              8
-Const MCI_FORMAT_SAMPLES =            9
-Const MCI_FORMAT_TMSF =               10
-
-
-'--------------
-' Types of MCI
-'--------------
-
-Type MCI_OPEN_PARMS
-	dwCallback As DWord
-	wDeviceID As DWord
-	lpstrDeviceType As BytePtr
-	lpstrElementName As BytePtr
-	lpstrAlias As BytePtr
-End Type
-
-Type MCI_PLAY_PARMS
-	dwCallback As DWord
-	dwFrom As DWord
-	dwTo As DWord
-End Type
-
-Type MCI_SEEK_PARMS
-	dwCallback As DWord
-	dwTo As DWord
-End Type
-
-Type MCI_SET_PARMS
-	dwCallback As DWord
-	dwTimeFormat As DWord
-	dwAudio As DWord
-End Type
-
-Const MCI_STATUS_LENGTH =             &H00000001
-Const MCI_STATUS_POSITION =           &H00000002
-Const MCI_STATUS_NUMBER_OF_TRACKS =   &H00000003
-Const MCI_STATUS_MODE =               &H00000004
-Const MCI_STATUS_MEDIA_PRESENT =      &H00000005
-Const MCI_STATUS_TIME_FORMAT =        &H00000006
-Const MCI_STATUS_READY =              &H00000007
-Const MCI_STATUS_CURRENT_TRACK =      &H00000008
-Type MCI_STATUS_PARMS
-	dwCallback As DWord
-	dwReturn As DWord
-	dwItem As DWord
-	dwTrack As DWord
-End Type
-
-
-'------------
-' MCI Macros
-
-Function MCI_MAKE_TMSF(tracks As Byte, minutes As Byte, seconds As Byte, frames As Byte) As DWord
-	MCI_MAKE_TMSF=MAKELONG(MAKEWORD(tracks,minutes),MAKEWORD(seconds,frames))
-End Function
-
-Function MCI_MSF_MINUTE(dwMFS As DWord) As Byte
-	MCI_MSF_MINUTE=LOBYTE(LOWORD(dwMFS))
-End Function
-
-Function MCI_MSF_SECOND(dwMFS As DWord) As Byte
-	MCI_MSF_SECOND=HIBYTE(LOWORD(dwMFS))
-End Function
-
-
-'---------------
+TypeDef MCIERROR = DWord
+TypeDef MCIDEVICEID = DWord
+TypeDef YIELDPROC = *Function(mciId As MCIDEVICEID, dwYieldData As DWord) As DWord
+
 ' MCI Functions
-
-' common flags for dwFlags parameter of MCI command messages
-Const MCI_NOTIFY =                    &H00000001
-Const MCI_WAIT =                      &H00000002
-Const MCI_FROM =                      &H00000004
-Const MCI_TO =                        &H00000008
-Const MCI_TRACK =                     &H00000010
-
-' flags for dwFlags parameter of MCI_OPEN command message
-Const MCI_OPEN_SHAREABLE =            &H00000100
-Const MCI_OPEN_ELEMENT =              &H00000200
-Const MCI_OPEN_ALIAS =                &H00000400
-Const MCI_OPEN_ELEMENT_ID =           &H00000800
-Const MCI_OPEN_TYPE_ID =              &H00001000
-Const MCI_OPEN_TYPE =                 &H00002000
-Const MCI_ANIM_OPEN_WS =              &H00010000
-Const MCI_ANIM_OPEN_PARENT =          &H00020000
-Const MCI_ANIM_OPEN_NOSTATIC =        &H00040000
-Const MCI_DGV_OPEN_WS =               &H00010000
-Const MCI_DGV_OPEN_PARENT =           &H00020000
-Const MCI_DGV_OPEN_NOSTATIC =         &H00040000
-Const MCI_DGV_OPEN_16BIT =            &H00080000
-Const MCI_DGV_OPEN_32BIT =            &H00100000
-Const MCI_OVLY_OPEN_WS =              &H00010000
-Const MCI_OVLY_OPEN_PARENT =          &H00020000
-
-' flags for dwFlags parameter of MCI_PLAY command message
-Const MCI_ANIM_PLAY_SPEED =        &H00010000
-Const MCI_ANIM_PLAY_REVERSE =      &H00020000
-Const MCI_ANIM_PLAY_FAST =         &H00040000
-Const MCI_ANIM_PLAY_SLOW =         &H00080000
-Const MCI_ANIM_PLAY_SCAN =         &H00100000
-Const MCI_DGV_PLAY_REPEAT =        &H00010000
-Const MCI_DGV_PLAY_REVERSE =       &H00020000
-Const MCI_MCIAVI_PLAY_WINDOW =     &H01000000
-Const MCI_MCIAVI_PLAY_FULLSCREEN = &H02000000
-Const MCI_VCR_PLAY_REVERSE =       &H00010000
-Const MCI_VCR_PLAY_AT =            &H00020000
-Const MCI_VCR_PLAY_SCAN =          &H00040000
-Const MCI_VD_PLAY_REVERSE =        &H00010000
-Const MCI_VD_PLAY_FAST =           &H00020000
-Const MCI_VD_PLAY_SPEED =          &H00040000
-Const MCI_VD_PLAY_SCAN =           &H00080000
-Const MCI_VD_PLAY_SLOW =           &H00100000
-
-' flags for dwFlags parameter of MCI_SEEK command message
-Const MCI_SEEK_TO_START =    &H00000100
-Const MCI_SEEK_TO_END =      &H00000200
-Const MCI_VCR_SEEK_REVERSE = &H00010000
-Const MCI_VCR_SEEK_MARK =    &H00020000
-Const MCI_VCR_SEEK_AT =      &H00040000
-Const MCI_VD_SEEK_REVERSE =  &H00010000
-
-' flags for dwFlags parameter of MCI_SET command message
-Const MCI_SET_DOOR_OPEN =             &H00000100
-Const MCI_SET_DOOR_CLOSED =           &H00000200
-Const MCI_SET_TIME_FORMAT =           &H00000400
-Const MCI_SET_AUDIO =                 &H00000800
-Const MCI_SET_VIDEO =                 &H00001000
-Const MCI_SET_ON =                    &H00002000
-Const MCI_SET_OFF =                   &H00004000
-Const MCI_DGV_SET_SEEK_EXACTLY =      &H00010000
-Const MCI_DGV_SET_SPEED =             &H00020000
-Const MCI_DGV_SET_STILL =             &H00040000
-Const MCI_DGV_SET_FILEFORMAT =        &H00080000
-Const MCI_SEQ_FORMAT_SONGPTR =        &H4001
-Const     MCI_SEQ_FILE =   &H4002
-Const     MCI_SEQ_MIDI =   &H4003
-Const     MCI_SEQ_SMPTE =  &H4004
-Const     MCI_SEQ_NONE =   65533
-Const     MCI_SEQ_MAPPER = 65535
-Const MCI_SEQ_SET_TEMPO =             &H00010000
-Const MCI_SEQ_SET_PORT =              &H00020000
-Const MCI_SEQ_SET_SLAVE =             &H00040000
-Const MCI_SEQ_SET_MASTER =            &H00080000
-Const MCI_SEQ_SET_OFFSET =            &H01000000
-Const MCI_VCR_SET_TIME_MODE =         &H00010000
-Const MCI_VCR_SET_POWER =             &H00020000
-Const MCI_VCR_SET_RECORD_FORMAT =     &H00040000
-Const MCI_VCR_SET_COUNTER_FORMAT =    &H00080000
-Const MCI_VCR_SET_INDEX =             &H00100000
-Const MCI_VCR_SET_ASSEMBLE_RECORD =   &H00200000
-Const MCI_VCR_SET_TRACKING =          &H00400000
-Const MCI_VCR_SET_SPEED =             &H00800000
-Const MCI_VCR_SET_TAPE_LENGTH =       &H01000000
-Const MCI_VCR_SET_COUNTER_VALUE =     &H02000000
-Const MCI_VCR_SET_CLOCK =             &H04000000
-Const MCI_VCR_SET_PAUSE_TIMEOUT =     &H08000000
-Const MCI_VCR_SET_PREROLL_DURATION =  &H10000000
-Const MCI_VCR_SET_POSTROLL_DURATION = &H20000000
-Const MCI_VD_FORMAT_TRACK =           &H4001
-Const MCI_WAVE_SET_FORMATTAG =        &H00010000
-Const MCI_WAVE_SET_CHANNELS =         &H00020000
-Const MCI_WAVE_SET_SAMPLESPERSEC =    &H00040000
-Const MCI_WAVE_SET_AVGBYTESPERSEC =   &H00080000
-Const MCI_WAVE_SET_BLOCKALIGN =       &H00100000
-Const MCI_WAVE_SET_BITSPERSAMPLE =    &H00200000
-Const MCI_WAVE_INPUT =                &H00400000
-Const MCI_WAVE_OUTPUT =               &H00800000
-Const MCI_WAVE_SET_ANYINPUT =         &H04000000
-Const MCI_WAVE_SET_ANYOUTPUT =        &H08000000
-
-' flags for dwFlags parameter of MCI_STATUS command message
-Const MCI_STATUS_ITEM =               &H00000100
-Const MCI_STATUS_START =              &H00000200
-Const MCI_CDA_STATUS_TYPE_TRACK =     &H00004001
-Const     MCI_CDA_TRACK_AUDIO = MCI_CD_OFFSET+0
-Const     MCI_CDA_TRACK_OTHER = MCI_CD_OFFSET+1
-Const MCI_DGV_STATUS_NOMINAL =        &H00020000
-Const MCI_DGV_STATUS_REFERENCE =      &H00040000
-Const MCI_DGV_STATUS_LEFT =           &H00080000
-Const MCI_DGV_STATUS_RIGHT =          &H00100000
-Const MCI_DGV_STATUS_DISKSPACE =      &H00200000
-Const MCI_DGV_STATUS_INPUT =          &H00400000
-Const MCI_DGV_STATUS_OUTPUT =         &H00800000
-Const MCI_DGV_STATUS_RECORD =         &H01000000
+Declare Function mciSendCommand Lib "winmm" Alias "mciSendCommandA" (mciId As MCIDEVICEID, uMsg As DWord, dwParam1 As DWord, ByRef dwParam2 As Any) As MCIERROR
+Declare Function mciSendString Lib "winmm" Alias "mciSendStringA" (lpstrCommand As LPSTR, lpstrReturnString As LPSTR, uReturnLength As DWord, hwndCallback As HWND) As MCIERROR
+Declare Function mciGetDeviceID Lib "winmm" Alias "mciGetDeviceIDA" (pszDevice As LPSTR) As MCIDEVICEID
+
+Declare Function mciGetErrorString Lib "winmm" Alias "mciGetErrorStringA" (mcierr As MCIERROR, pszText As LPSTR, cchText As DWord) As BOOL
+Declare Function mciSetYieldProc Lib "winmm" (mciId As MCIDEVICEID, fpYieldProc As YIELDPROC, dwYieldData As DWord) As BOOL
+Declare Function mciGetCreatorTask Lib "winmm" (mciId As MCIDEVICEID) As HTASK
+Declare Function mciGetYieldProc Lib "winmm" (mciId As MCIDEVICEID, pdwYieldData As *DWord) As YIELDPROC
+Declare Function mciExecute Lib "winmm" (pszCommand As LPSTR) As BOOL
+
+Const MCIERR_INVALID_DEVICE_ID = (MCIERR_BASE + 1)
+Const MCIERR_UNRECOGNIZED_KEYWORD = (MCIERR_BASE + 3)
+Const MCIERR_UNRECOGNIZED_COMMAND = (MCIERR_BASE + 5)
+Const MCIERR_HARDWARE = (MCIERR_BASE + 6)
+Const MCIERR_INVALID_DEVICE_NAME = (MCIERR_BASE + 7)
+Const MCIERR_OUT_OF_MEMORY = (MCIERR_BASE + 8)
+Const MCIERR_DEVICE_OPEN = (MCIERR_BASE + 9)
+Const MCIERR_CANNOT_LOAD_DRIVER = (MCIERR_BASE + 10)
+Const MCIERR_MISSING_COMMAND_STRING = (MCIERR_BASE + 11)
+Const MCIERR_PARAM_OVERFLOW = (MCIERR_BASE + 12)
+Const MCIERR_MISSING_STRING_ARGUMENT = (MCIERR_BASE + 13)
+Const MCIERR_BAD_INTEGER = (MCIERR_BASE + 14)
+Const MCIERR_PARSER_INTERNAL = (MCIERR_BASE + 15)
+Const MCIERR_DRIVER_INTERNAL = (MCIERR_BASE + 16)
+Const MCIERR_MISSING_PARAMETER = (MCIERR_BASE + 17)
+Const MCIERR_UNSUPPORTED_FUNCTION = (MCIERR_BASE + 18)
+Const MCIERR_FILE_NOT_FOUND = (MCIERR_BASE + 19)
+Const MCIERR_DEVICE_NOT_READY = (MCIERR_BASE + 20)
+Const MCIERR_INTERNAL = (MCIERR_BASE + 21)
+Const MCIERR_DRIVER = (MCIERR_BASE + 22)
+Const MCIERR_CANNOT_USE_ALL = (MCIERR_BASE + 23)
+Const MCIERR_MULTIPLE = (MCIERR_BASE + 24)
+Const MCIERR_EXTENSION_NOT_FOUND = (MCIERR_BASE + 25)
+Const MCIERR_OUTOFRANGE = (MCIERR_BASE + 26)
+Const MCIERR_FLAGS_NOT_COMPATIBLE = (MCIERR_BASE + 28)
+Const MCIERR_FILE_NOT_SAVED = (MCIERR_BASE + 30)
+Const MCIERR_DEVICE_TYPE_REQUIRED = (MCIERR_BASE + 31)
+Const MCIERR_DEVICE_LOCKED = (MCIERR_BASE + 32)
+Const MCIERR_DUPLICATE_ALIAS = (MCIERR_BASE + 33)
+Const MCIERR_BAD_CONSTANT = (MCIERR_BASE + 34)
+Const MCIERR_MUST_USE_SHAREABLE = (MCIERR_BASE + 35)
+Const MCIERR_MISSING_DEVICE_NAME = (MCIERR_BASE + 36)
+Const MCIERR_BAD_TIME_FORMAT = (MCIERR_BASE + 37)
+Const MCIERR_NO_CLOSING_QUOTE = (MCIERR_BASE + 38)
+Const MCIERR_DUPLICATE_FLAGS = (MCIERR_BASE + 39)
+Const MCIERR_INVALID_FILE = (MCIERR_BASE + 40)
+Const MCIERR_NULL_PARAMETER_BLOCK = (MCIERR_BASE + 41)
+Const MCIERR_UNNAMED_RESOURCE = (MCIERR_BASE + 42)
+Const MCIERR_NEW_REQUIRES_ALIAS = (MCIERR_BASE + 43)
+Const MCIERR_NOTIFY_ON_AUTO_OPEN = (MCIERR_BASE + 44)
+Const MCIERR_NO_ELEMENT_ALLOWED = (MCIERR_BASE + 45)
+Const MCIERR_NONAPPLICABLE_FUNCTION = (MCIERR_BASE + 46)
+Const MCIERR_ILLEGAL_FOR_AUTO_OPEN = (MCIERR_BASE + 47)
+Const MCIERR_FILENAME_REQUIRED = (MCIERR_BASE + 48)
+Const MCIERR_EXTRA_CHARACTERS = (MCIERR_BASE + 49)
+Const MCIERR_DEVICE_NOT_INSTALLED = (MCIERR_BASE + 50)
+Const MCIERR_GET_CD = (MCIERR_BASE + 51)
+Const MCIERR_SET_CD = (MCIERR_BASE + 52)
+Const MCIERR_SET_DRIVE = (MCIERR_BASE + 53)
+Const MCIERR_DEVICE_LENGTH = (MCIERR_BASE + 54)
+Const MCIERR_DEVICE_ORD_LENGTH = (MCIERR_BASE + 55)
+Const MCIERR_NO_INTEGER = (MCIERR_BASE + 56)
+
+Const MCIERR_WAVE_OUTPUTSINUSE = (MCIERR_BASE + 64)
+Const MCIERR_WAVE_SETOUTPUTINUSE = (MCIERR_BASE + 65)
+Const MCIERR_WAVE_INPUTSINUSE = (MCIERR_BASE + 66)
+Const MCIERR_WAVE_SETINPUTINUSE = (MCIERR_BASE + 67)
+Const MCIERR_WAVE_OUTPUTUNSPECIFIED = (MCIERR_BASE + 68)
+Const MCIERR_WAVE_INPUTUNSPECIFIED = (MCIERR_BASE + 69)
+Const MCIERR_WAVE_OUTPUTSUNSUITABLE = (MCIERR_BASE + 70)
+Const MCIERR_WAVE_SETOUTPUTUNSUITABLE = (MCIERR_BASE + 71)
+Const MCIERR_WAVE_INPUTSUNSUITABLE = (MCIERR_BASE + 72)
+Const MCIERR_WAVE_SETINPUTUNSUITABLE = (MCIERR_BASE + 73)
+
+Const MCIERR_SEQ_DIV_INCOMPATIBLE = (MCIERR_BASE + 80)
+Const MCIERR_SEQ_PORT_INUSE = (MCIERR_BASE + 81)
+Const MCIERR_SEQ_PORT_NONEXISTENT = (MCIERR_BASE + 82)
+Const MCIERR_SEQ_PORT_MAPNODEVICE = (MCIERR_BASE + 83)
+Const MCIERR_SEQ_PORT_MISCERROR = (MCIERR_BASE + 84)
+Const MCIERR_SEQ_TIMER = (MCIERR_BASE + 85)
+Const MCIERR_SEQ_PORTUNSPECIFIED = (MCIERR_BASE + 86)
+Const MCIERR_SEQ_NOMIDIPRESENT = (MCIERR_BASE + 87)
+
+Const MCIERR_NO_WINDOW = (MCIERR_BASE + 90)
+Const MCIERR_CREATEWINDOW = (MCIERR_BASE + 91)
+Const MCIERR_FILE_READ = (MCIERR_BASE + 92)
+Const MCIERR_FILE_WRITE = (MCIERR_BASE + 93)
+Const MCIERR_NO_IDENTITY = (MCIERR_BASE + 94)
+Const MCIERR_CUSTOM_DRIVER_BASE = (MCIERR_BASE + 256)
+
+Const MCI_FIRST = DRV_MCI_FIRST
+Const MCI_OPEN = &H0803
+Const MCI_CLOSE = &H0804
+Const MCI_ESCAPE = &H0805
+Const MCI_PLAY = &H0806
+Const MCI_SEEK = &H0807
+Const MCI_STOP = &H0808
+Const MCI_PAUSE = &H0809
+Const MCI_INFO = &H080A
+Const MCI_GETDEVCAPS = &H080B
+Const MCI_SPIN = &H080C
+Const MCI_SET = &H080D
+Const MCI_STEP = &H080E
+Const MCI_RECORD = &H080F
+Const MCI_SYSINFO = &H0810
+Const MCI_BREAK = &H0811
+Const MCI_SAVE = &H0813
+Const MCI_STATUS = &H0814
+Const MCI_CUE = &H0830
+Const MCI_REALIZE = &H0840
+Const MCI_WINDOW = &H0841
+Const MCI_PUT = &H0842
+Const MCI_WHERE = &H0843
+Const MCI_FREEZE = &H0844
+Const MCI_UNFREEZE = &H0845
+Const MCI_LOAD = &H0850
+Const MCI_CUT = &H0851
+Const MCI_COPY = &H0852
+Const MCI_PASTE = &H0853
+Const MCI_UPDATE = &H0854
+Const MCI_RESUME = &H0855
+Const MCI_DELETE = &H0856
+
+Const MCI_USER_MESSAGES = (DRV_MCI_FIRST + &H400)
+Const MCI_LAST = &H0FFF
+
+Const MCI_ALL_DEVICE_ID = (-1)
 
 ' constants for predefined MCI device types
@@ -1593,4 +1526,7 @@
 Const MCI_DEVTYPE_WAVEFORM_AUDIO =    522
 Const MCI_DEVTYPE_SEQUENCER =         523
+Const MCI_DEVTYPE_FIRST =             MCI_DEVTYPE_VCR
+Const MCI_DEVTYPE_LAST =              MCI_DEVTYPE_SEQUENCER
+Const MCI_DEVTYPE_FIRST_USER =        &H1000
 
 ' return values for 'status mode' command
@@ -1603,115 +1539,629 @@
 Const MCI_MODE_OPEN =                 MCI_STRING_OFFSET + 18
 
-Const MCI_OPEN =                      &H0803
-Const MCI_CLOSE =                     &H0804
-Const MCI_ESCAPE =                    &H0805
-Const MCI_PLAY =                      &H0806
-Const MCI_SEEK =                      &H0807
-Const MCI_STOP =                      &H0808
-Const MCI_PAUSE =                     &H0809
-Const MCI_INFO =                      &H080A
-Const MCI_GETDEVCAPS =                &H080B
-Const MCI_SPIN =                      &H080C
-Const MCI_SET =                       &H080D
-Const MCI_STEP =                      &H080E
-Const MCI_RECORD =                    &H080F
-Const MCI_SYSINFO =                   &H0810
-Const MCI_BREAK =                     &H0811
-Const MCI_SAVE =                      &H0813
-Const MCI_STATUS =                    &H0814
-Const MCI_CUE =                       &H0830
-Const MCI_REALIZE =                   &H0840
-Const MCI_WINDOW =                    &H0841
-Const MCI_PUT =                       &H0842
-Const MCI_WHERE =                     &H0843
-Const MCI_FREEZE =                    &H0844
-Const MCI_UNFREEZE =                  &H0845
-Const MCI_LOAD =                      &H0850
-Const MCI_CUT =                       &H0851
-Const MCI_COPY =                      &H0852
-Const MCI_PASTE =                     &H0853
-Const MCI_UPDATE =                    &H0854
-Const MCI_RESUME =                    &H0855
-Const MCI_DELETE =                    &H0856
-Declare Function mciSendCommand Lib "winmm" Alias "mciSendCommandA" (dwMciID As DWord, uMsg As DWord, fdwCommand As DWord, ByRef lpParam As Any) As DWord
-
-Const MCIERR_INVALID_DEVICE_ID =       MCIERR_BASE + 1
-Const MCIERR_UNRECOGNIZED_KEYWORD =    MCIERR_BASE + 3
-Const MCIERR_UNRECOGNIZED_COMMAND =    MCIERR_BASE + 5
-Const MCIERR_HARDWARE =                MCIERR_BASE + 6
-Const MCIERR_INVALID_DEVICE_NAME =     MCIERR_BASE + 7
-Const MCIERR_OUT_OF_MEMORY =           MCIERR_BASE + 8
-Const MCIERR_DEVICE_OPEN =             MCIERR_BASE + 9
-Const MCIERR_CANNOT_LOAD_DRIVER =      MCIERR_BASE + 10
-Const MCIERR_MISSING_COMMAND_STRING =  MCIERR_BASE + 11
-Const MCIERR_PARAM_OVERFLOW =          MCIERR_BASE + 12
-Const MCIERR_MISSING_STRING_ARGUMENT = MCIERR_BASE + 13
-Const MCIERR_BAD_INTEGER =             MCIERR_BASE + 14
-Const MCIERR_PARSER_INTERNAL =         MCIERR_BASE + 15
-Const MCIERR_DRIVER_INTERNAL =         MCIERR_BASE + 16
-Const MCIERR_MISSING_PARAMETER =       MCIERR_BASE + 17
-Const MCIERR_UNSUPPORTED_FUNCTION =    MCIERR_BASE + 18
-Const MCIERR_FILE_NOT_FOUND =          MCIERR_BASE + 19
-Const MCIERR_DEVICE_NOT_READY =        MCIERR_BASE + 20
-Const MCIERR_INTERNAL =                MCIERR_BASE + 21
-Const MCIERR_DRIVER =                  MCIERR_BASE + 22
-Const MCIERR_CANNOT_USE_ALL =          MCIERR_BASE + 23
-Const MCIERR_MULTIPLE =                MCIERR_BASE + 24
-Const MCIERR_EXTENSION_NOT_FOUND =     MCIERR_BASE + 25
-Const MCIERR_OUTOFRANGE =              MCIERR_BASE + 26
-Const MCIERR_FLAGS_NOT_COMPATIBLE =    MCIERR_BASE + 28
-Const MCIERR_FILE_NOT_SAVED =          MCIERR_BASE + 30
-Const MCIERR_DEVICE_TYPE_REQUIRED =    MCIERR_BASE + 31
-Const MCIERR_DEVICE_LOCKED =           MCIERR_BASE + 32
-Const MCIERR_DUPLICATE_ALIAS =         MCIERR_BASE + 33
-Const MCIERR_BAD_CONSTANT =            MCIERR_BASE + 34
-Const MCIERR_MUST_USE_SHAREABLE =      MCIERR_BASE + 35
-Const MCIERR_MISSING_DEVICE_NAME =     MCIERR_BASE + 36
-Const MCIERR_BAD_TIME_FORMAT =         MCIERR_BASE + 37
-Const MCIERR_NO_CLOSING_QUOTE =        MCIERR_BASE + 38
-Const MCIERR_DUPLICATE_FLAGS =         MCIERR_BASE + 39
-Const MCIERR_INVALID_FILE =            MCIERR_BASE + 40
-Const MCIERR_NULL_PARAMETER_BLOCK =    MCIERR_BASE + 41
-Const MCIERR_UNNAMED_RESOURCE =        MCIERR_BASE + 42
-Const MCIERR_NEW_REQUIRES_ALIAS =      MCIERR_BASE + 43
-Const MCIERR_NOTIFY_ON_AUTO_OPEN =     MCIERR_BASE + 44
-Const MCIERR_NO_ELEMENT_ALLOWED =      MCIERR_BASE + 45
-Const MCIERR_NONAPPLICABLE_FUNCTION =  MCIERR_BASE + 46
-Const MCIERR_ILLEGAL_FOR_AUTO_OPEN =   MCIERR_BASE + 47
-Const MCIERR_FILENAME_REQUIRED =       MCIERR_BASE + 48
-Const MCIERR_EXTRA_CHARACTERS =        MCIERR_BASE + 49
-Const MCIERR_DEVICE_NOT_INSTALLED =    MCIERR_BASE + 50
-Const MCIERR_GET_CD =                  MCIERR_BASE + 51
-Const MCIERR_SET_CD =                  MCIERR_BASE + 52
-Const MCIERR_SET_DRIVE =               MCIERR_BASE + 53
-Const MCIERR_DEVICE_LENGTH =           MCIERR_BASE + 54
-Const MCIERR_DEVICE_ORD_LENGTH =       MCIERR_BASE + 55
-Const MCIERR_NO_INTEGER =              MCIERR_BASE + 56
-Const MCIERR_WAVE_OUTPUTSINUSE =       MCIERR_BASE + 64
-Const MCIERR_WAVE_SETOUTPUTINUSE =     MCIERR_BASE + 65
-Const MCIERR_WAVE_INPUTSINUSE =        MCIERR_BASE + 66
-Const MCIERR_WAVE_SETINPUTINUSE =      MCIERR_BASE + 67
-Const MCIERR_WAVE_OUTPUTUNSPECIFIED =  MCIERR_BASE + 68
-Const MCIERR_WAVE_INPUTUNSPECIFIED =   MCIERR_BASE + 69
-Const MCIERR_WAVE_OUTPUTSUNSUITABLE =  MCIERR_BASE + 70
-Const MCIERR_WAVE_SETOUTPUTUNSUITABLE = MCIERR_BASE + 71
-Const MCIERR_WAVE_INPUTSUNSUITABLE =   MCIERR_BASE + 72
-Const MCIERR_WAVE_SETINPUTUNSUITABLE = MCIERR_BASE + 73
-Const MCIERR_SEQ_DIV_INCOMPATIBLE =    MCIERR_BASE + 80
-Const MCIERR_SEQ_PORT_INUSE =          MCIERR_BASE + 81
-Const MCIERR_SEQ_PORT_NONEXISTENT =    MCIERR_BASE + 82
-Const MCIERR_SEQ_PORT_MAPNODEVICE =    MCIERR_BASE + 83
-Const MCIERR_SEQ_PORT_MISCERROR =      MCIERR_BASE + 84
-Const MCIERR_SEQ_TIMER =               MCIERR_BASE + 85
-Const MCIERR_SEQ_PORTUNSPECIFIED =     MCIERR_BASE + 86
-Const MCIERR_SEQ_NOMIDIPRESENT =       MCIERR_BASE + 87
-Const MCIERR_NO_WINDOW =               MCIERR_BASE + 90
-Const MCIERR_CREATEWINDOW =            MCIERR_BASE + 91
-Const MCIERR_FILE_READ =               MCIERR_BASE + 92
-Const MCIERR_FILE_WRITE =              MCIERR_BASE + 93
-Const MCIERR_NO_IDENTITY =             MCIERR_BASE + 94
-Const MCIERR_CUSTOM_DRIVER_BASE =      MCIERR_BASE + 256
-Declare Function mciGetErrorString Lib "winmm" Alias "mciGetErrorStringA" (mcierr As DWord, pszText As PSTR, cchText As Long) As BOOL
-
+'--------------------------------------------------------
+' Time Format(used in MCI_SET_PARAMS, MCI_STATUS_PARAMS)
+
+Const MCI_FORMAT_MILLISECONDS =       0
+Const MCI_FORMAT_HMS =                1
+Const MCI_FORMAT_MSF =                2
+Const MCI_FORMAT_FRAMES =             3
+Const MCI_FORMAT_SMPTE_24 =           4
+Const MCI_FORMAT_SMPTE_25 =           5
+Const MCI_FORMAT_SMPTE_30 =           6
+Const MCI_FORMAT_SMPTE_30DROP =       7
+Const MCI_FORMAT_BYTES =              8
+Const MCI_FORMAT_SAMPLES =            9
+Const MCI_FORMAT_TMSF =               10
+
+'------------
+' MCI Macros
+
+'MSF
+Function MCI_MSF_MINUTE(msf As DWord) As Byte
+	Return (&HFF AND msf)
+End Function
+Function MCI_MSF_SECOND(msf As DWord) As Byte
+	Return (&HFF AND (msf>> 8))
+End Function
+Function MCI_MSF_FRAME(msf As DWord) As Byte
+	Return (&HFF AND (msf>>16))
+End Function
+Function MCI_MAKE_MSF(minutes As Byte, seconds As Byte, frames As Byte) As DWord
+	Return MAKELONG(minutes,MAKEWORD(seconds,frames))
+End Function
+
+'TMSF
+Function MCI_TMSF_TRACK(tmsf As DWord) As Byte
+	Return (&HFF AND (tmsf))
+End Function
+Function MCI_TMSF_MINUTE(tmsf As DWord) As Byte
+	Return (&HFF AND (((tmsf)) >> 8))
+End Function
+Function MCI_TMSF_SECOND(tmsf As DWord) As Byte
+	Return (&HFF AND ((tmsf)>>16))
+End Function
+Function MCI_TMSF_FRAME(tmsf As DWord) As Byte
+	Return (&HFF AND ((tmsf)>>24))
+End Function
+Function MCI_MAKE_TMSF(tracks As Byte, minutes As Byte, seconds As Byte, frames As Byte) As DWord
+	Return MAKELONG(MAKEWORD(tracks,minutes),MAKEWORD(seconds,frames))
+End Function
+
+'HMS
+Function MCI_HMS_HOUR(hms As DWord) As Byte
+	Return (&HFF AND (hms))
+End Function
+Function MCI_HMS_MINUTE(hms As DWord) As Byte
+	Return (&HFF AND ((hms)>> 8))
+End Function
+Function MCI_HMS_SECOND(hms As DWord) As Byte
+	Return (&HFF AND ((hms)>>16))
+End Function
+Function MCI_MAKE_HMS(hours As Byte, minutes As Byte, seconds As Byte) As DWord
+	Return MAKELONG(hours,MAKEWORD(minutes,seconds))
+End Function
+
+' flags for wParam of MM_MCINOTIFY message
+Const MCI_NOTIFY_SUCCESSFUL = &H0001
+Const MCI_NOTIFY_SUPERSEDED = &H0002
+Const MCI_NOTIFY_ABORTED = &H0004
+Const MCI_NOTIFY_FAILURE = &H0008
+
+' common flags for dwFlags parameter of MCI command messages
+Const MCI_NOTIFY =                    &H00000001
+Const MCI_WAIT =                      &H00000002
+Const MCI_FROM =                      &H00000004
+Const MCI_TO =                        &H00000008
+Const MCI_TRACK =                     &H00000010
+
+' flags for dwFlags parameter of MCI_OPEN command message
+Const MCI_OPEN_SHAREABLE =            &H00000100
+Const MCI_OPEN_ELEMENT =              &H00000200
+Const MCI_OPEN_ALIAS =                &H00000400
+Const MCI_OPEN_ELEMENT_ID =           &H00000800
+Const MCI_OPEN_TYPE_ID =              &H00001000
+Const MCI_OPEN_TYPE =                 &H00002000
+
+' flags for dwFlags parameter of MCI_SEEK command message
+Const MCI_SEEK_TO_START = &H00000100
+Const MCI_SEEK_TO_END = &H00000200
+
+' flags for dwFlags parameter of MCI_STATUS command message
+Const MCI_STATUS_ITEM = &H00000100
+Const MCI_STATUS_START = &H00000200
+
+' flags for dwItem field of the MCI_STATUS_PARMS parameter block
+Const MCI_STATUS_LENGTH = &H00000001
+Const MCI_STATUS_POSITION = &H00000002
+Const MCI_STATUS_NUMBER_OF_TRACKS = &H00000003
+Const MCI_STATUS_MODE = &H00000004
+Const MCI_STATUS_MEDIA_PRESENT = &H00000005
+Const MCI_STATUS_TIME_FORMAT = &H00000006
+Const MCI_STATUS_READY = &H00000007
+Const MCI_STATUS_CURRENT_TRACK = &H00000008
+
+' flags for dwFlags parameter of MCI_INFO command message
+Const MCI_INFO_PRODUCT = &H00000100
+Const MCI_INFO_FILE = &H00000200
+Const MCI_INFO_MEDIA_UPC = &H00000400
+Const MCI_INFO_MEDIA_IDENTITY = &H00000800
+Const MCI_INFO_NAME = &H00001000
+Const MCI_INFO_COPYRIGHT = &H00002000
+
+' flags for dwFlags parameter of MCI_GETDEVCAPS command message
+Const MCI_GETDEVCAPS_ITEM = &H00000100
+
+' flags for dwItem field of the MCI_GETDEVCAPS_PARMS parameter block
+Const MCI_GETDEVCAPS_CAN_RECORD = &H00000001
+Const MCI_GETDEVCAPS_HAS_AUDIO = &H00000002
+Const MCI_GETDEVCAPS_HAS_VIDEO = &H00000003
+Const MCI_GETDEVCAPS_DEVICE_TYPE = &H00000004
+Const MCI_GETDEVCAPS_USES_FILES = &H00000005
+Const MCI_GETDEVCAPS_COMPOUND_DEVICE = &H00000006
+Const MCI_GETDEVCAPS_CAN_EJECT = &H00000007
+Const MCI_GETDEVCAPS_CAN_PLAY = &H00000008
+Const MCI_GETDEVCAPS_CAN_SAVE = &H00000009
+
+' flags for dwFlags parameter of MCI_SYSINFO command message
+Const MCI_SYSINFO_QUANTITY = &H00000100
+Const MCI_SYSINFO_OPEN = &H00000200
+Const MCI_SYSINFO_NAME = &H00000400
+Const MCI_SYSINFO_INSTALLNAME = &H00000800
+
+' flags for dwFlags parameter of MCI_SET command message
+Const MCI_SET_DOOR_OPEN = &H00000100
+Const MCI_SET_DOOR_CLOSED = &H00000200
+Const MCI_SET_TIME_FORMAT = &H00000400
+Const MCI_SET_AUDIO = &H00000800
+Const MCI_SET_VIDEO = &H00001000
+Const MCI_SET_ON = &H00002000
+Const MCI_SET_OFF = &H00004000
+
+' flags for dwAudio field of MCI_SET_PARMS or MCI_SEQ_SET_PARMS
+Const MCI_SET_AUDIO_ALL = &H00000000
+Const MCI_SET_AUDIO_LEFT = &H00000001
+Const MCI_SET_AUDIO_RIGHT = &H00000002
+
+' flags for dwFlags parameter of MCI_BREAK command message
+Const MCI_BREAK_KEY = &H00000100
+Const MCI_BREAK_HWND = &H00000200
+Const MCI_BREAK_OFF = &H00000400
+
+' flags for dwFlags parameter of MCI_RECORD command message
+Const MCI_RECORD_INSERT = &H00000100
+Const MCI_RECORD_OVERWRITE = &H00000200
+
+' flags for dwFlags parameter of MCI_SAVE command message
+Const MCI_SAVE_FILE = &H00000100
+
+' flags for dwFlags parameter of MCI_LOAD command message
+Const MCI_LOAD_FILE = &H00000100
+
+Type MCI_GENERIC_PARMS
+	dwCallback As DWord
+End Type
+TypeDef PMCI_GENERIC_PARMS = *MCI_GENERIC_PARMS
+TypeDef LPMCI_GENERIC_PARMS = *MCI_GENERIC_PARMS
+
+Type MCI_OPEN_PARMS
+	dwCallback As DWord
+	wDeviceID As DWord
+	lpstrDeviceType As LPSTR
+	lpstrElementName As LPSTR
+	lpstrAlias As LPSTR
+End Type
+TypeDef PMCI_OPEN_PARMS = *MCI_OPEN_PARMS
+TypeDef LPMCI_OPEN_PARMS = *MCI_OPEN_PARMS
+
+Type MCI_PLAY_PARMS
+	dwCallback As DWord
+	dwFrom As DWord
+	dwTo As DWord
+End Type
+TypeDef PMCI_PLAY_PARMS = *MCI_PLAY_PARMS
+TypeDef LPMCI_PLAY_PARMS = *MCI_PLAY_PARMS
+
+Type MCI_SEEK_PARMS
+	dwCallback As DWord
+	dwTo As DWord
+End Type
+TypeDef PMCI_SEEK_PARMS = *MCI_SEEK_PARMS
+TypeDef LPMCI_SEEK_PARMS = *MCI_SEEK_PARMS
+
+Type MCI_STATUS_PARMS
+	dwCallback As DWord
+	dwReturn As DWord
+	dwItem As DWord
+	dwTrack As DWord
+End Type
+TypeDef PMCI_STATUS_PARMS = *MCI_STATUS_PARMS
+TypeDef LPMCI_STATUS_PARMS = *MCI_STATUS_PARMS
+
+Type MCI_INFO_PARMSA
+	dwCallback As DWord
+	lpstrReturn As LPSTR
+	dwRetSize As DWord
+End Type
+TypeDef PMCI_INFO_PARMSA = *MCI_INFO_PARMSA
+TypeDef LPMCI_INFO_PARMSA = *MCI_INFO_PARMSA
+TypeDef MCI_INFO_PARMS = MCI_INFO_PARMSA
+TypeDef PMCI_INFO_PARMS = PMCI_INFO_PARMSA
+TypeDef LPMCI_INFO_PARMS = LPMCI_INFO_PARMSA
+
+Type MCI_GETDEVCAPS_PARMS
+	dwCallback As DWord
+	dwReturn As DWord
+	dwItem As DWord
+End Type
+TypeDef PMCI_GETDEVCAPS_PARMS = *MCI_GETDEVCAPS_PARMS
+TypeDef LPMCI_GETDEVCAPS_PARMS = *MCI_GETDEVCAPS_PARMS
+
+Type MCI_SYSINFO_PARMSA
+	dwCallback As DWord
+	lpstrReturn As LPSTR
+	dwRetSize As DWord
+	dwNumber As DWord
+	wDeviceType As DWord
+End Type
+TypeDef PMCI_SYSINFO_PARMSA = *MCI_SYSINFO_PARMSA
+TypeDef LPMCI_SYSINFO_PARMSA = *MCI_SYSINFO_PARMSA
+TypeDef MCI_SYSINFO_PARMS = MCI_SYSINFO_PARMSA
+TypeDef PMCI_SYSINFO_PARMS = PMCI_SYSINFO_PARMSA
+TypeDef LPMCI_SYSINFO_PARMS = LPMCI_SYSINFO_PARMSA
+
+Type MCI_SET_PARMS
+	dwCallback As DWord
+	dwTimeFormat As DWord
+	dwAudio As DWord
+End Type
+TypeDef PMCI_SET_PARMS = *MCI_SET_PARMS
+TypeDef LPMCI_SET_PARMS = *MCI_SET_PARMS
+
+Type MCI_BREAK_PARMS
+	dwCallback As DWord
+	nVirtKey As Long
+	hwndBreak As HWND
+End Type
+TypeDef PMCI_BREAK_PARMS = *MCI_BREAK_PARMS
+TypeDef LPMCI_BREAK_PARMS = *MCI_BREAK_PARMS
+
+Type MCI_SAVE_PARMSA
+	dwCallback As DWord
+	lpfilename As LPSTR
+End Type
+TypeDef PMCI_SAVE_PARMSA = *MCI_SAVE_PARMSA
+TypeDef LPMCI_SAVE_PARMSA = *MCI_SAVE_PARMSA
+TypeDef MCI_SAVE_PARMS = MCI_SAVE_PARMSA
+TypeDef PMCI_SAVE_PARMS = PMCI_SAVE_PARMSA
+TypeDef LPMCI_SAVE_PARMS = LPMCI_SAVE_PARMSA
+
+Type MCI_LOAD_PARMSA
+	dwCallback As DWord
+	lpfilename As LPSTR
+End Type
+TypeDef PMCI_LOAD_PARMSA = *MCI_LOAD_PARMSA
+TypeDef LPMCI_LOAD_PARMSA = *MCI_LOAD_PARMSA
+TypeDef MCI_LOAD_PARMS = MCI_LOAD_PARMSA
+TypeDef PMCI_LOAD_PARMS = PMCI_LOAD_PARMSA
+TypeDef LPMCI_LOAD_PARMS = LPMCI_LOAD_PARMSA
+
+Type MCI_RECORD_PARMS
+	dwCallback As DWord
+	dwFrom As DWord
+	dwTo As DWord
+End Type
+TypeDef PMCI_RECORD_PARMS = *MCI_RECORD_PARMS
+TypeDef LPMCI_RECORD_PARMS = *MCI_RECORD_PARMS
+
+' MCI extensions for videodisc devices
+Const MCI_VD_MODE_PARK =              (MCI_VD_OFFSET + 1)
+Const MCI_VD_MEDIA_CLV =              (MCI_VD_OFFSET + 2)
+Const MCI_VD_MEDIA_CAV =              (MCI_VD_OFFSET + 3)
+Const MCI_VD_MEDIA_OTHER =            (MCI_VD_OFFSET + 4)
+Const MCI_VD_FORMAT_TRACK =           &H4001
+Const MCI_VD_PLAY_REVERSE =           &H00010000
+Const MCI_VD_PLAY_FAST =              &H00020000
+Const MCI_VD_PLAY_SPEED =             &H00040000
+Const MCI_VD_PLAY_SCAN =              &H00080000
+Const MCI_VD_PLAY_SLOW =              &H00100000
+Const MCI_VD_SEEK_REVERSE =           &H00010000
+Const MCI_VD_STATUS_SPEED =           &H00004002
+Const MCI_VD_STATUS_FORWARD =         &H00004003
+Const MCI_VD_STATUS_MEDIA_TYPE =      &H00004004
+Const MCI_VD_STATUS_SIDE =            &H00004005
+Const MCI_VD_STATUS_DISC_SIZE =       &H00004006
+Const MCI_VD_GETDEVCAPS_CLV =         &H00010000
+Const MCI_VD_GETDEVCAPS_CAV =         &H00020000
+Const MCI_VD_SPIN_UP =                &H00010000
+Const MCI_VD_SPIN_DOWN =              &H00020000
+Const MCI_VD_GETDEVCAPS_CAN_REVERSE = &H00004002
+Const MCI_VD_GETDEVCAPS_FAST_RATE =   &H00004003
+Const MCI_VD_GETDEVCAPS_SLOW_RATE =   &H00004004
+Const MCI_VD_GETDEVCAPS_NORMAL_RATE = &H00004005
+Const MCI_VD_STEP_FRAMES =            &H00010000
+Const MCI_VD_STEP_REVERSE =           &H00020000
+Const MCI_VD_ESCAPE_STRING =          &H00000100
+
+Type MCI_VD_PLAY_PARMS
+	dwCallback As DWord
+	dwFrom As DWord
+	dwTo As DWord
+	dwSpeed As DWord
+End Type
+TypeDef PMCI_VD_PLAY_PARMS = *MCI_VD_PLAY_PARMS
+TypeDef LPMCI_VD_PLAY_PARMS = *MCI_VD_PLAY_PARMS
+
+Type MCI_VD_STEP_PARMS
+	dwCallback As DWord
+	dwFrames As DWord
+End Type
+TypeDef PMCI_VD_STEP_PARMS = *MCI_VD_STEP_PARMS
+TypeDef LPMCI_VD_STEP_PARMS = *MCI_VD_STEP_PARMS
+
+Type MCI_VD_ESCAPE_PARMSA
+	dwCallback As DWord
+	lpstrCommand As LPSTR
+End Type
+TypeDef PMCI_VD_ESCAPE_PARMSA = *MCI_VD_ESCAPE_PARMSA
+TypeDef LPMCI_VD_ESCAPE_PARMSA = *MCI_VD_ESCAPE_PARMSA
+TypeDef MCI_VD_ESCAPE_PARMS = MCI_VD_ESCAPE_PARMSA
+TypeDef PMCI_VD_ESCAPE_PARMS = PMCI_VD_ESCAPE_PARMSA
+TypeDef LPMCI_VD_ESCAPE_PARMS = LPMCI_VD_ESCAPE_PARMSA
+
+' MCI extensions for CD audio devices
+Const MCI_CDA_STATUS_TYPE_TRACK = &H00004001
+Const MCI_CDA_TRACK_AUDIO = (MCI_CD_OFFSET + 0)
+Const MCI_CDA_TRACK_OTHER = (MCI_CD_OFFSET + 1)
+
+' MCI extensions for waveform audio devices
+Const MCI_WAVE_PCM =                   (MCI_WAVE_OFFSET + 0)
+Const MCI_WAVE_MAPPER =                (MCI_WAVE_OFFSET + 1)
+Const MCI_WAVE_OPEN_BUFFER =           &H00010000
+Const MCI_WAVE_SET_FORMATTAG =         &H00010000
+Const MCI_WAVE_SET_CHANNELS =          &H00020000
+Const MCI_WAVE_SET_SAMPLESPERSEC =     &H00040000
+Const MCI_WAVE_SET_AVGBYTESPERSEC =    &H00080000
+Const MCI_WAVE_SET_BLOCKALIGN =        &H00100000
+Const MCI_WAVE_SET_BITSPERSAMPLE =     &H00200000
+Const MCI_WAVE_INPUT =                 &H00400000
+Const MCI_WAVE_OUTPUT =                &H00800000
+Const MCI_WAVE_STATUS_FORMATTAG =      &H00004001
+Const MCI_WAVE_STATUS_CHANNELS =       &H00004002
+Const MCI_WAVE_STATUS_SAMPLESPERSEC =  &H00004003
+Const MCI_WAVE_STATUS_AVGBYTESPERSEC = &H00004004
+Const MCI_WAVE_STATUS_BLOCKALIGN =     &H00004005
+Const MCI_WAVE_STATUS_BITSPERSAMPLE =  &H00004006
+Const MCI_WAVE_STATUS_LEVEL =          &H00004007
+Const MCI_WAVE_SET_ANYINPUT =          &H04000000
+Const MCI_WAVE_SET_ANYOUTPUT =         &H08000000
+Const MCI_WAVE_GETDEVCAPS_INPUTS =     &H00004001
+Const MCI_WAVE_GETDEVCAPS_OUTPUTS =    &H00004002
+
+Type MCI_WAVE_OPEN_PARMSA
+	dwCallback As DWord
+	wDeviceID As MCIDEVICEID
+	lpstrDeviceType As LPSTR
+	lpstrElementName As LPSTR
+	lpstrAlias As LPSTR
+	dwBufferSeconds As DWord
+End Type
+TypeDef PMCI_WAVE_OPEN_PARMSA = *MCI_WAVE_OPEN_PARMSA
+TypeDef LPMCI_WAVE_OPEN_PARMSA = *MCI_WAVE_OPEN_PARMSA
+TypeDef MCI_WAVE_OPEN_PARMS = MCI_WAVE_OPEN_PARMSA
+TypeDef PMCI_WAVE_OPEN_PARMS = PMCI_WAVE_OPEN_PARMSA
+TypeDef LPMCI_WAVE_OPEN_PARMS = LPMCI_WAVE_OPEN_PARMSA
+
+Type MCI_WAVE_DELETE_PARMS
+	dwCallback As DWord
+	dwFrom As DWord
+	dwTo As DWord
+End Type
+TypeDef PMCI_WAVE_DELETE_PARMS = *MCI_WAVE_DELETE_PARMS
+TypeDef LPMCI_WAVE_DELETE_PARMS = *MCI_WAVE_DELETE_PARMS
+
+Type MCI_WAVE_SET_PARMS
+	dwCallback As DWord
+	dwTimeFormat As DWord
+	dwAudio As DWord
+	wInput As DWord
+	wOutput As DWord
+	wFormatTag As Word
+	wReserved2 As Word
+	nChannels As Word
+	wReserved3 As Word
+	nSamplesPerSec As DWord
+	nAvgBytesPerSec As DWord
+	nBlockAlign As Word
+	wReserved4 As Word
+	wBitsPerSample As Word
+	wReserved5 As Word
+End Type
+TypeDef PMCI_WAVE_SET_PARMS = *MCI_WAVE_SET_PARMS
+TypeDef LPMCI_WAVE_SET_PARMS = *MCI_WAVE_SET_PARMS
+
+' MCI extensions for MIDI sequencer devices
+Const MCI_SEQ_DIV_PPQN =         (0 + MCI_SEQ_OFFSET)
+Const MCI_SEQ_DIV_SMPTE_24 =     (1 + MCI_SEQ_OFFSET)
+Const MCI_SEQ_DIV_SMPTE_25 =     (2 + MCI_SEQ_OFFSET)
+Const MCI_SEQ_DIV_SMPTE_30DROP = (3 + MCI_SEQ_OFFSET)
+Const MCI_SEQ_DIV_SMPTE_30 =     (4 + MCI_SEQ_OFFSET)
+Const MCI_SEQ_FORMAT_SONGPTR =   &H4001
+Const MCI_SEQ_FILE =             &H4002
+Const MCI_SEQ_MIDI =             &H4003
+Const MCI_SEQ_SMPTE =            &H4004
+Const MCI_SEQ_NONE =             65533
+Const MCI_SEQ_MAPPER =           65535
+Const MCI_SEQ_STATUS_TEMPO =     &H00004002
+Const MCI_SEQ_STATUS_PORT =      &H00004003
+Const MCI_SEQ_STATUS_SLAVE =     &H00004007
+Const MCI_SEQ_STATUS_MASTER =    &H00004008
+Const MCI_SEQ_STATUS_OFFSET =    &H00004009
+Const MCI_SEQ_STATUS_DIVTYPE =   &H0000400A
+Const MCI_SEQ_STATUS_NAME =      &H0000400B
+Const MCI_SEQ_STATUS_COPYRIGHT = &H0000400C
+Const MCI_SEQ_SET_TEMPO =        &H00010000
+Const MCI_SEQ_SET_PORT =         &H00020000
+Const MCI_SEQ_SET_SLAVE =        &H00040000
+Const MCI_SEQ_SET_MASTER =       &H00080000
+Const MCI_SEQ_SET_OFFSET =       &H01000000
+
+Type MCI_SEQ_SET_PARMS
+	dwCallback As DWord
+	dwTimeFormat As DWord
+	dwAudio As DWord
+	dwTempo As DWord
+	dwPort As DWord
+	dwSlave As DWord
+	dwMaster As DWord
+	dwOffset As DWord
+End Type
+TypeDef PMCI_SEQ_SET_PARMS = *MCI_SEQ_SET_PARMS
+TypeDef LPMCI_SEQ_SET_PARMS = *MCI_SEQ_SET_PARMS
+
+' MCI extensions for animation devices
+Const MCI_ANIM_OPEN_WS =                &H00010000
+Const MCI_ANIM_OPEN_PARENT =            &H00020000
+Const MCI_ANIM_OPEN_NOSTATIC =          &H00040000
+Const MCI_ANIM_PLAY_SPEED =             &H00010000
+Const MCI_ANIM_PLAY_REVERSE =           &H00020000
+Const MCI_ANIM_PLAY_FAST =              &H00040000
+Const MCI_ANIM_PLAY_SLOW =              &H00080000
+Const MCI_ANIM_PLAY_SCAN =              &H00100000
+Const MCI_ANIM_STEP_REVERSE =           &H00010000
+Const MCI_ANIM_STEP_FRAMES =            &H00020000
+Const MCI_ANIM_STATUS_SPEED =           &H00004001
+Const MCI_ANIM_STATUS_FORWARD =         &H00004002
+Const MCI_ANIM_STATUS_HWND =            &H00004003
+Const MCI_ANIM_STATUS_HPAL =            &H00004004
+Const MCI_ANIM_STATUS_STRETCH =         &H00004005
+Const MCI_ANIM_INFO_TEXT =              &H00010000
+Const MCI_ANIM_GETDEVCAPS_CAN_REVERSE = &H00004001
+Const MCI_ANIM_GETDEVCAPS_FAST_RATE =   &H00004002
+Const MCI_ANIM_GETDEVCAPS_SLOW_RATE =   &H00004003
+Const MCI_ANIM_GETDEVCAPS_NORMAL_RATE = &H00004004
+Const MCI_ANIM_GETDEVCAPS_PALETTES =    &H00004006
+Const MCI_ANIM_GETDEVCAPS_CAN_STRETCH = &H00004007
+Const MCI_ANIM_GETDEVCAPS_MAX_WINDOWS = &H00004008
+Const MCI_ANIM_REALIZE_NORM =           &H00010000
+Const MCI_ANIM_REALIZE_BKGD =           &H00020000
+Const MCI_ANIM_WINDOW_HWND =            &H00010000
+Const MCI_ANIM_WINDOW_STATE =           &H00040000
+Const MCI_ANIM_WINDOW_TEXT =            &H00080000
+Const MCI_ANIM_WINDOW_ENABLE_STRETCH =  &H00100000
+Const MCI_ANIM_WINDOW_DISABLE_STRETCH = &H00200000
+Const MCI_ANIM_WINDOW_DEFAULT =         &H00000000
+Const MCI_ANIM_RECT =                   &H00010000
+Const MCI_ANIM_PUT_SOURCE =             &H00020000
+Const MCI_ANIM_PUT_DESTINATION =        &H00040000
+Const MCI_ANIM_WHERE_SOURCE =           &H00020000
+Const MCI_ANIM_WHERE_DESTINATION =      &H00040000
+Const MCI_ANIM_UPDATE_HDC =             &H00020000
+
+Type MCI_ANIM_OPEN_PARMSA
+	dwCallback As DWord
+	wDeviceID As MCIDEVICEID
+	lpstrDeviceType As LPSTR
+	lpstrElementName As LPSTR
+	lpstrAlias As LPSTR
+	dwStyle As DWord
+	hWndParent As HWND
+End Type
+TypeDef PMCI_ANIM_OPEN_PARMSA = *MCI_ANIM_OPEN_PARMSA
+TypeDef LPMCI_ANIM_OPEN_PARMSA = *MCI_ANIM_OPEN_PARMSA
+TypeDef MCI_ANIM_OPEN_PARMS = MCI_ANIM_OPEN_PARMSA
+TypeDef PMCI_ANIM_OPEN_PARMS = PMCI_ANIM_OPEN_PARMSA
+TypeDef LPMCI_ANIM_OPEN_PARMS = LPMCI_ANIM_OPEN_PARMSA
+
+Type MCI_ANIM_PLAY_PARMS
+	dwCallback As DWord
+	dwFrom As DWord
+	dwTo As DWord
+	dwSpeed As DWord
+End Type
+TypeDef PMCI_ANIM_PLAY_PARMS = *MCI_ANIM_PLAY_PARMS
+TypeDef LPMCI_ANIM_PLAY_PARMS = *MCI_ANIM_PLAY_PARMS
+
+Type MCI_ANIM_STEP_PARMS
+	dwCallback As DWord
+	dwFrames As DWord
+End Type
+TypeDef PMCI_ANIM_STEP_PARMS = *MCI_ANIM_STEP_PARMS
+TypeDef LPMCI_ANIM_STEP_PARMS = *MCI_ANIM_STEP_PARMS
+
+Type MCI_ANIM_WINDOW_PARMSA
+	dwCallback As DWord
+	hWnd As HWND
+	nCmdShow As DWord
+	lpstrText As LPSTR
+End Type
+TypeDef PMCI_ANIM_WINDOW_PARMSA = *MCI_ANIM_WINDOW_PARMSA
+TypeDef LPMCI_ANIM_WINDOW_PARMSA = *MCI_ANIM_WINDOW_PARMSA
+TypeDef MCI_ANIM_WINDOW_PARMS = MCI_ANIM_WINDOW_PARMSA
+TypeDef PMCI_ANIM_WINDOW_PARMS = PMCI_ANIM_WINDOW_PARMSA
+TypeDef LPMCI_ANIM_WINDOW_PARMS = LPMCI_ANIM_WINDOW_PARMSA
+
+Type MCI_ANIM_RECT_PARMS
+	dwCallback As DWord
+	rc As RECT
+End Type
+TypeDef PMCI_ANIM_RECT_PARMS = *MCI_ANIM_RECT_PARMS
+TypeDef LPMCI_ANIM_RECT_PARMS = *MCI_ANIM_RECT_PARMS
+
+Type MCI_ANIM_UPDATE_PARMS
+	dwCallback As DWord
+	rc As RECT
+	hDC As HDC
+End Type
+TypeDef PMCI_ANIM_UPDATE_PARMS = *MCI_ANIM_UPDATE_PARMS
+TypeDef LPMCI_ANIM_UPDATE_PARMS = *MCI_ANIM_UPDATE_PARMS
+
+' MCI extensions for video overlay devices
+Const MCI_OVLY_OPEN_WS =                &H00010000
+Const MCI_OVLY_OPEN_PARENT =            &H00020000
+Const MCI_OVLY_STATUS_HWND =            &H00004001
+Const MCI_OVLY_STATUS_STRETCH =         &H00004002
+Const MCI_OVLY_INFO_TEXT =              &H00010000
+Const MCI_OVLY_GETDEVCAPS_CAN_STRETCH = &H00004001
+Const MCI_OVLY_GETDEVCAPS_CAN_FREEZE =  &H00004002
+Const MCI_OVLY_GETDEVCAPS_MAX_WINDOWS = &H00004003
+Const MCI_OVLY_WINDOW_HWND =            &H00010000
+Const MCI_OVLY_WINDOW_STATE =           &H00040000
+Const MCI_OVLY_WINDOW_TEXT =            &H00080000
+Const MCI_OVLY_WINDOW_ENABLE_STRETCH =  &H00100000
+Const MCI_OVLY_WINDOW_DISABLE_STRETCH = &H00200000
+Const MCI_OVLY_WINDOW_DEFAULT =         &H00000000
+Const MCI_OVLY_RECT =                   &H00010000
+Const MCI_OVLY_PUT_SOURCE =             &H00020000
+Const MCI_OVLY_PUT_DESTINATION =        &H00040000
+Const MCI_OVLY_PUT_FRAME =              &H00080000
+Const MCI_OVLY_PUT_VIDEO =              &H00100000
+Const MCI_OVLY_WHERE_SOURCE =           &H00020000
+Const MCI_OVLY_WHERE_DESTINATION =      &H00040000
+Const MCI_OVLY_WHERE_FRAME =            &H00080000
+Const MCI_OVLY_WHERE_VIDEO =            &H00100000
+
+Type MCI_OVLY_OPEN_PARMSA
+	dwCallback As DWord
+	wDeviceID As MCIDEVICEID
+	lpstrDeviceType As LPSTR
+	lpstrElementName As LPSTR
+	lpstrAlias As LPSTR
+	dwStyle As DWord
+	hWndParent As HWND
+End Type
+TypeDef PMCI_OVLY_OPEN_PARMSA = *MCI_OVLY_OPEN_PARMSA
+TypeDef LPMCI_OVLY_OPEN_PARMSA = *MCI_OVLY_OPEN_PARMSA
+TypeDef MCI_OVLY_OPEN_PARMS = MCI_OVLY_OPEN_PARMSA
+TypeDef PMCI_OVLY_OPEN_PARMS = PMCI_OVLY_OPEN_PARMSA
+TypeDef LPMCI_OVLY_OPEN_PARMS = LPMCI_OVLY_OPEN_PARMSA
+
+Type MCI_OVLY_WINDOW_PARMSA
+	dwCallback As DWord
+	hWnd As HWND
+	nCmdShow As DWord
+	lpstrText As LPSTR
+End Type
+TypeDef PMCI_OVLY_WINDOW_PARMSA = *MCI_OVLY_WINDOW_PARMSA
+TypeDef LPMCI_OVLY_WINDOW_PARMSA = *MCI_OVLY_WINDOW_PARMSA
+TypeDef MCI_OVLY_WINDOW_PARMS = MCI_OVLY_WINDOW_PARMSA
+TypeDef PMCI_OVLY_WINDOW_PARMS = PMCI_OVLY_WINDOW_PARMSA
+TypeDef LPMCI_OVLY_WINDOW_PARMS = LPMCI_OVLY_WINDOW_PARMSA
+
+Type MCI_OVLY_RECT_PARMS
+	dwCallback As DWord
+	rc As RECT
+End Type
+TypeDef PMCI_OVLY_RECT_PARMS = *MCI_OVLY_RECT_PARMS
+TypeDef LPMCI_OVLY_RECT_PARMS = *MCI_OVLY_RECT_PARMS
+
+Type MCI_OVLY_SAVE_PARMSA
+	dwCallback As DWord
+	lpfilename As LPSTR
+	rc As RECT
+End Type
+TypeDef PMCI_OVLY_SAVE_PARMSA = *MCI_OVLY_SAVE_PARMSA
+TypeDef LPMCI_OVLY_SAVE_PARMSA = *MCI_OVLY_SAVE_PARMSA
+TypeDef MCI_OVLY_SAVE_PARMS = MCI_OVLY_SAVE_PARMSA
+TypeDef PMCI_OVLY_SAVE_PARMS = PMCI_OVLY_SAVE_PARMSA
+TypeDef LPMCI_OVLY_SAVE_PARMS = LPMCI_OVLY_SAVE_PARMSA
+
+Type MCI_OVLY_LOAD_PARMSA
+	dwCallback As DWord
+	lpfilename As LPSTR
+	rc As RECT
+End Type
+TypeDef PMCI_OVLY_LOAD_PARMSA = *MCI_OVLY_LOAD_PARMSA
+TypeDef LPMCI_OVLY_LOAD_PARMSA = *MCI_OVLY_LOAD_PARMSA
+TypeDef MCI_OVLY_LOAD_PARMS = MCI_OVLY_LOAD_PARMSA
+TypeDef PMCI_OVLY_LOAD_PARMS = PMCI_OVLY_LOAD_PARMSA
+TypeDef LPMCI_OVLY_LOAD_PARMS = LPMCI_OVLY_LOAD_PARMSA
+
+' DISPLAY Driver extensions
+Const NEWTRANSPARENT = 3
+Const QUERYROPSUPPORT = 40
+
+' DIB Driver extensions
+Const SELECTDIB = 41
+Const DIBINDEX(n) = MAKELONG(n,&H10FF)
 
 #endif '_INC_MMSYS
