' **************************************************************************
'
'         Multimedia API Declares adapted from MMSYSTEM.H
'
'         Copyright (c) 1990-1993, Microsoft Corp.  All rights reserved.
'
' **************************************************************************



' ***************************************************************************

'                     General constants and data types

' ****************************************************************************/

'  general constants
Public Const MAXPNAMELEN = 32           '  max product name length (including NULL)
Public Const MAXERRORLENGTH = 128       '  max error text length (including NULL)

Type RECT   ' Same as Windows API
    left As Integer
    top As Integer
    right As Integer
    bottom As Integer
End Type

'  MMTIME data structure

Type SMPTE
    hour As String * 1          '  hours
    min As String * 1           '  minutes
    sec As String * 1           '  seconds
    frame As String * 1         '  frames
    fps As String * 1           '  frames per second
    dummy As String * 1         '  pad
End Type

Type MMTIME
    wType As Integer        '  indicates the contents of units
    units As Long           '  (msecs, samples, bytes)
    SMPTEVal As SMPTE
    songptrpos As Long      '  song pointer position
End Type


'  types for wType field in MMTIME struct
Public Const TIME_MS = &H1              '  time in milliseconds
Public Const TIME_SAMPLES = &H2         '  number of wave samples
Public Const TIME_BYTES = &H4           '  current byte offset
Public Const TIME_SMPTE = &H8           '  SMPTE time
Public Const TIME_MIDI = &H10           '  MIDI time


' ***************************************************************************

'                     Multimedia Extensions Window Messages

' ****************************************************************************/

Public Const MM_JOY1MOVE = &H3A0                    '  joystick
Public Const MM_JOY2MOVE = &H3A1
Public Const MM_JOY1ZMOVE = &H3A2
Public Const MM_JOY2ZMOVE = &H3A3
Public Const MM_JOY1BUTTONDOWN = &H3B5
Public Const MM_JOY2BUTTONDOWN = &H3B6
Public Const MM_JOY1BUTTONUP = &H3B7
Public Const MM_JOY2BUTTONUP = &H3B8

Public Const MM_MCINOTIFY = &H3B9                   '  MCI

Public Const MM_WOM_OPEN = &H3BB                    '  waveform output
Public Const MM_WOM_CLOSE = &H3BC
Public Const MM_WOM_DONE = &H3BD

Public Const MM_WIM_OPEN = &H3BE                    '  waveform input
Public Const MM_WIM_CLOSE = &H3BF
Public Const MM_WIM_DATA = &H3C0

Public Const MM_MIM_OPEN = &H3C1                    '  MIDI input
Public Const MM_MIM_CLOSE = &H3C2
Public Const MM_MIM_DATA = &H3C3
Public Const MM_MIM_LONGDATA = &H3C4
Public Const MM_MIM_ERROR = &H3C5
Public Const MM_MIM_LONGERROR = &H3C6

Public Const MM_MOM_OPEN = &H3C7                    '  MIDI output
Public Const MM_MOM_CLOSE = &H3C8
Public Const MM_MOM_DONE = &H3C9


' ***************************************************************************

'                 String resource number bases (internal use)

' ****************************************************************************/

Public Const MMSYSERR_BASE = 0
Public Const WAVERR_BASE = 32
Public Const MIDIERR_BASE = 64
Public Const TIMERR_BASE = 96
Public Const JOYERR_BASE = 160
Public Const MCIERR_BASE = 256

Public Const MCI_STRING_OFFSET = 512
Public Const MCI_VD_OFFSET = 1024
Public Const MCI_CD_OFFSET = 1088
Public Const MCI_WAVE_OFFSET = 1152
Public Const MCI_SEQ_OFFSET = 1216

' ***************************************************************************

'                         General error return values

' ****************************************************************************/

'  general error return values
Public Const MMSYSERR_NOERROR = 0                          '  no error
Public Const MMSYSERR_ERROR = (MMSYSERR_BASE + 1)          '  unspecified error
Public Const MMSYSERR_BADDEVICEID = (MMSYSERR_BASE + 2)    '  device ID out of range
Public Const MMSYSERR_NOTENABLED = (MMSYSERR_BASE + 3)     '  driver failed enable
Public Const MMSYSERR_ALLOCATED = (MMSYSERR_BASE + 4)      '  device already allocated
Public Const MMSYSERR_INVALHANDLE = (MMSYSERR_BASE + 5)    '  device handle is invalid
Public Const MMSYSERR_NODRIVER = (MMSYSERR_BASE + 6)       '  no device driver present
Public Const MMSYSERR_NOMEM = (MMSYSERR_BASE + 7)          '  memory allocation error
Public Const MMSYSERR_NOTSUPPORTED = (MMSYSERR_BASE + 8)   '  function isn't supported
Public Const MMSYSERR_BADERRNUM = (MMSYSERR_BASE + 9)      '  error value out of range
Public Const MMSYSERR_INVALFLAG = (MMSYSERR_BASE + 10)     '  invalid flag passed
Public Const MMSYSERR_INVALPARAM = (MMSYSERR_BASE + 11)    '  invalid parameter passed
Public Const MMSYSERR_LASTERROR = (MMSYSERR_BASE + 11)     '  last error in range


' ***************************************************************************

'                         Installable driver support

' ****************************************************************************/

'  return values from DriverProc() function
Public Const DRV_CANCEL = &H0
Public Const DRV_OK = &H1
Public Const DRV_RESTART = &H2

'  Driver messages
Public Const DRV_LOAD = &H1
Public Const DRV_ENABLE = &H2
Public Const DRV_OPEN = &H3
Public Const DRV_CLOSE = &H4
Public Const DRV_DISABLE = &H5
Public Const DRV_FREE = &H6
Public Const DRV_CONFIGURE = &H7
Public Const DRV_QUERYCONFIGURE = &H8
Public Const DRV_INSTALL = &H9
Public Const DRV_REMOVE = &HA
Public Const DRV_RESERVED = &H800
Public Const DRV_USER = &H4000

'  LPARAM of DRV_CONFIGURE message
Type DRVCONFIGINFO
	dwDCISize As Long
	lpszDCISectionName As String
	lpszDCIAliasName As String
End Type

'  installable driver function prototypes
Declare Function DrvClose Lib "MMSYSTEM" (ByVal hDriver As Integer, ByVal lParam1 As Long, ByVal lParam2 As Long) As Long
Declare Function DrvOpen Lib "MMSYSTEM" (ByVal szDriverName As String, ByVal szSectionName As String, ByVal lParam2 As Long) As Integer
Declare Function DrvSendMessage Lib "MMSYSTEM" (ByVal hDriver As Integer, ByVal uMessage As Integer, ByVal lParam1 As Long, ByVal lParam2 As Long) As Long
Declare Function DrvGetModuleHandle Lib "MMSYSTEM" (ByVal hDriver As Integer) As Integer
Declare Function DrvDefDriverProc Lib "MMSYSTEM" (ByVal dwDriverIdentifier As Long, ByVal driverID As Integer, ByVal uMessage As Integer, ByVal lParam1 As Long, ByVal lParam2 As Long) As Long


' ***************************************************************************

'                           Driver callback support

' ****************************************************************************/

'  flags used with waveOutOpen(), waveInOpen(), midiInOpen(), and
'  midiOutOpen() to specify the type of the dwCallback parameter.

Public Const CALLBACK_TYPEMASK = &H70000           '  callback type mask
Public Const CALLBACK_NULL = &H0&                  '  no callback
Public Const CALLBACK_WINDOW = &H10000             '  dwCallback is a HWND
Public Const CALLBACK_TASK = &H20000               '  dwCallback is a HTASK
Public Const CALLBACK_FUNCTION = &H30000           '  dwCallback is a FARPROC


' ***************************************************************************

'                          Manufacturer and product IDs
	
'     Used with wMid and wPid fields in WAVEOUTCAPS, WAVEINCAPS,
'     MIDIOUTCAPS, MIDIINCAPS, AUXCAPS, JOYCAPS structures.

' ****************************************************************************/

'  manufacturer IDs
Public Const MM_MICROSOFT = 1                   '  Microsoft Corp.

'  product IDs
Public Const MM_MIDI_MAPPER = 1                 '  MIDI Mapper
Public Const MM_WAVE_MAPPER = 2                 '  Wave Mapper
Public Const MM_SNDBLST_MIDIOUT = 3             '  Sound Blaster MIDI output port
Public Const MM_SNDBLST_MIDIIN = 4              '  Sound Blaster MIDI input port
Public Const MM_SNDBLST_SYNTH = 5               '  Sound Blaster internal synthesizer
Public Const MM_SNDBLST_WAVEOUT = 6             '  Sound Blaster waveform output
Public Const MM_SNDBLST_WAVEIN = 7              '  Sound Blaster waveform input
Public Const MM_ADLIB = 9                       '  Ad Lib-compatible synthesizer
Public Const MM_MPU401_MIDIOUT = 10             '  MPU401-compatible MIDI output port
Public Const MM_MPU401_MIDIIN = 11              '  MPU401-compatible MIDI input port
Public Const MM_PC_JOYSTICK = 12                '  Joystick adapter


' ***************************************************************************

'                     General MMSYSTEM support

' ****************************************************************************/

Declare Function mmsystemGetVersion Lib "MMSYSTEM" () As Integer
Declare Sub OutputDebugStr Lib "MMSYSTEM" (ByVal LPCSTR As String)



' ***************************************************************************

'                             Sound support

' ****************************************************************************/

Declare Function sndPlaySound Lib "MMSYSTEM" (ByVal lpszSoundName As String, ByVal uFlags As Integer) As Integer

'  flag values for wFlags parameter
Public Const SND_SYNC = &H0                 '  play synchronously (default)
Public Const SND_ASYNC = &H1                '  play asynchronously
Public Const SND_NODEFAULT = &H2            '  don't 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              '  don't stop any currently playing sound

' ***************************************************************************

'                         Waveform audio support

' ****************************************************************************/

'  waveform audio error return values
Public Const WAVERR_BADFORMAT = (WAVERR_BASE + 0)          '  unsupported wave format
Public Const WAVERR_STILLPLAYING = (WAVERR_BASE + 1)       '  still something playing
Public Const WAVERR_UNPREPARED = (WAVERR_BASE + 2)         '  header not prepared
Public Const WAVERR_SYNC = (WAVERR_BASE + 3)               '  device is synchronous
Public Const WAVERR_LASTERROR = (WAVERR_BASE + 3)          '  last error in range

'  waveform audio data types

'  wave callback messages
Public Const WOM_OPEN = MM_WOM_OPEN
Public Const WOM_CLOSE = MM_WOM_CLOSE
Public Const WOM_DONE = MM_WOM_DONE
Public Const WIM_OPEN = MM_WIM_OPEN
Public Const WIM_CLOSE = MM_WIM_CLOSE
Public Const WIM_DATA = MM_WIM_DATA

'  device ID for wave device mapper
Public Const WAVE_MAPPER = (-1)

'  flags for dwFlags parameter in waveOutOpen() and waveInOpen()
Public Const WAVE_FORMAT_QUERY = &H1
Public Const WAVE_ALLOWSYNC = &H2

'  wave data block header
Type WAVEHDR
    lpData As Long                 '  pointer to locked data buffer
    dwBufferLength As Long         '  length of data buffer
    dwBytesRecorded As Long        '  used for input only
    dwUser As Long                 '  for client's use
    dwFlags As Long                '  assorted flags (see defines)
    dwLoops As Long                '  loop control counter
    wavehdr_tag As Long            '  reserved for driver
    reserved As Long               '  reserved for driver
End Type

'  flags for dwFlags field of WAVEHDR
Public Const WHDR_DONE = &H1                '  done bit
Public Const WHDR_PREPARED = &H2            '  set if this header has been prepared
Public Const WHDR_BEGINLOOP = &H4           '  loop start block
Public Const WHDR_ENDLOOP = &H8             '  loop end block
Public Const WHDR_INQUEUE = &H10            '  reserved for driver

'  waveform output device capabilities structure
Type WAVEOUTCAPS
    wMid As Integer                  '  manufacturer ID
    wPid As Integer                  '  product ID
    vDriverVersion As Integer        '  version of the driver
    szPname As String * MAXPNAMELEN  '  product name (NULL terminated string)
    dwFormats As Long                '  formats supported
    wChannels As Integer             '  number of sources supported
    dwSupport As Long                '  functionality supported by driver
End Type
' typedef WAVEOUTCAPS       *PWAVEOUTCAPS;
' typedef WAVEOUTCAPS NEAR *NPWAVEOUTCAPS;
' typedef WAVEOUTCAPS FAR  *LPWAVEOUTCAPS;

'  flags for dwSupport field of WAVEOUTCAPS
Public Const WAVECAPS_PITCH = &H1                '  supports pitch control
Public Const WAVECAPS_PLAYBACKRATE = &H2         '  supports playback rate control
Public Const WAVECAPS_VOLUME = &H4               '  supports volume control
Public Const WAVECAPS_LRVOLUME = &H8             '  separate left-right volume control
Public Const WAVECAPS_SYNC = &H10

'  waveform input device capabilities structure
Type WAVEINCAPS
    wMid As Integer                    '  manufacturer ID
    wPid As Integer                    '  product ID
    vDriverVersion As Integer          '  version of the driver
    szPname As String * MAXPNAMELEN    '  product name (NULL terminated string)
    dwFormats As Long                  '  formats supported
    wChannels As Integer               '  number of channels supported
End Type

'  defines for dwFormat field of WAVEINCAPS and WAVEOUTCAPS
Public Const WAVE_INVALIDFORMAT = &H0                   '  invalid format
Public Const WAVE_FORMAT_1M08 = &H1                     '  11.025 kHz, Mono,   8-bit
Public Const WAVE_FORMAT_1S08 = &H2                     '  11.025 kHz, Stereo, 8-bit
Public Const WAVE_FORMAT_1M16 = &H4                     '  11.025 kHz, Mono,   16-bit
Public Const WAVE_FORMAT_1S16 = &H8                     '  11.025 kHz, Stereo, 16-bit
Public Const WAVE_FORMAT_2M08 = &H10                    '  22.05  kHz, Mono,   8-bit
Public Const WAVE_FORMAT_2S08 = &H20                    '  22.05  kHz, Stereo, 8-bit
Public Const WAVE_FORMAT_2M16 = &H40                    '  22.05  kHz, Mono,   16-bit
Public Const WAVE_FORMAT_2S16 = &H80                    '  22.05  kHz, Stereo, 16-bit
Public Const WAVE_FORMAT_4M08 = &H100                   '  44.1   kHz, Mono,   8-bit
Public Const WAVE_FORMAT_4S08 = &H200                   '  44.1   kHz, Stereo, 8-bit
Public Const WAVE_FORMAT_4M16 = &H400                   '  44.1   kHz, Mono,   16-bit
Public Const WAVE_FORMAT_4S16 = &H800                   '  44.1   kHz, Stereo, 16-bit

'  general waveform format structure (information common to all formats)
Type WAVEFORMAT
    wFormatTag As Integer     '  format type
    nChannels As Integer      '  number of channels (i.e. mono, stereo, etc.)
    nSamplesPerSec As Long    '  sample rate
    nAvgBytesPerSec As Long   '  for buffer estimation
    nBlockAlign As Integer    '  block size of data
End Type

'  flags for wFormatTag field of WAVEFORMAT
Public Const WAVE_FORMAT_PCM = 1

'  specific waveform format structure for PCM data
Type PCMWAVEFORMAT
    wf As WAVEFORMAT
    wBitsPerSample As Integer
End Type

'  waveform audio function prototypes
Declare Function waveOutGetNumDevs Lib "MMSYSTEM" () As Integer
Declare Function waveOutGetDevCaps Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpCaps As WAVEOUTCAPS, uSize As Integer) As Integer
Declare Function waveOutGetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpdwvolume As Long) As Integer
Declare Function waveOutSetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, ByVal dwVolume As Long) As Integer
Declare Function waveOutGetErrorText Lib "MMSYSTEM" (ByVal uError As Integer, ByVal lpText As String, ByVal uSize As Integer) As Integer
Declare Function waveOutOpen Lib "MMSYSTEM" (lpWaveout As Integer, ByVal UINT As Integer, lpformat As Integer, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal flags As Long) As Integer
Declare Function waveOutClose Lib "MMSYSTEM" (ByVal hWaveOut As Integer) As Integer
Declare Function waveOutPrepareHeader Lib "MMSYSTEM" (ByVal hWaveOut As Integer, WH As WAVEHDR, ByVal uSize As Integer) As Integer
Declare Function waveOutUnprepareHeader Lib "MMSYSTEM" (ByVal hWaveOut As Integer, WH As WAVEHDR, ByVal uSize As Integer) As Integer
Declare Function waveOutWrite Lib "MMSYSTEM" (ByVal hWaveOut As Integer, WH1 As WAVEHDR, ByVal uSize As Integer) As Integer
Declare Function waveOutPause Lib "MMSYSTEM" (ByVal hWaveOut As Integer) As Integer
Declare Function waveOutRestart Lib "MMSYSTEM" (ByVal hWaveOut As Integer) As Integer
Declare Function waveOutReset Lib "MMSYSTEM" (ByVal hWaveOut As Integer) As Integer
Declare Function waveOutBreakLoop Lib "MMSYSTEM" (ByVal hWaveOut As Integer) As Integer
Declare Function waveOutGetPosition Lib "MMSYSTEM" (ByVal hWaveOut As Integer, lpinfo As MMTIME, ByVal uSize As Integer) As Integer
Declare Function waveOutGetPitch Lib "MMSYSTEM" (ByVal hWaveOut As Integer, lpdwpitch As Long) As Integer
Declare Function waveOutSetPitch Lib "MMSYSTEM" (ByVal hWaveOut As Integer, ByVal dwPitch As Long) As Integer
Declare Function waveOutGetPlaybackRate Lib "MMSYSTEM" (ByVal hWaveOut As Integer, lpdwrate As Long) As Integer
Declare Function waveOutSetPlaybackRate Lib "MMSYSTEM" (ByVal hWaveOut As Integer, ByVal dwRate As Long) As Integer
Declare Function waveOutGetID Lib "MMSYSTEM" (ByVal hWaveOut As Integer, lpudeviceid As Integer) As Integer
Declare Function waveOutMessage Lib "MMSYSTEM" (ByVal hWaveOut As Integer, ByVal uMessage As Integer, ByVal dw1 As Long, ByVal dw2 As Long) As Long
Declare Function waveInGetNumDevs Lib "MMSYSTEM" () As Integer
Declare Function waveInGetDevCaps Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpCaps As WAVEINCAPS, ByVal uSize As Integer) As Integer
Declare Function waveInGetErrorText Lib "MMSYSTEM" (ByVal uError As Integer, ByVal lpText As String, ByVal uSize As Integer) As Integer
Declare Function waveInOpen Lib "MMSYSTEM" (lphWaveIn As Integer, ByVal udeviceid As Integer, lpformat As WAVEFORMAT, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal dwFlags As Long) As Integer
Declare Function waveInClose Lib "MMSYSTEM" (ByVal hWaveIn As Integer) As Integer
Declare Function waveInPrepareHeader Lib "MMSYSTEM" (ByVal hWaveIn As Integer, lpWaveInHdr As WAVEHDR, ByVal uSize As Integer) As Integer
Declare Function waveInUnprepareHeader Lib "MMSYSTEM" (ByVal hWaveIn As Integer, lpWaveInHdr As WAVEHDR, ByVal uSize As Integer) As Integer
Declare Function waveInAddBuffer Lib "MMSYSTEM" (ByVal hWaveIn As Integer, lpWaveInHdr As WAVEHDR, ByVal uSize As Integer) As Integer
Declare Function waveInStart Lib "MMSYSTEM" (ByVal hWaveIn As Integer) As Integer
Declare Function waveInStop Lib "MMSYSTEM" (ByVal hWaveIn As Integer) As Integer
Declare Function waveInReset Lib "MMSYSTEM" (ByVal hWaveIn As Integer) As Integer
Declare Function waveInGetPosition Lib "MMSYSTEM" (ByVal hWaveIn As Integer, lpinfo As MMTIME, ByVal uSize As Integer) As Integer
Declare Function waveInGetID Lib "MMSYSTEM" (ByVal hWaveIn As Integer, lpudeviceid As Integer) As Integer
Declare Function waveInMessage Lib "MMSYSTEM" (ByVal hWaveIn As Integer, ByVal uMessage As Integer, ByVal dw1 As Long, ByVal dw2 As Long) As Long


' ***************************************************************************

'                             MIDI audio support

' ****************************************************************************/

'  MIDI error return values
Public Const MIDIERR_UNPREPARED = (MIDIERR_BASE + 0)       '  header not prepared
Public Const MIDIERR_STILLPLAYING = (MIDIERR_BASE + 1)     '  still something playing
Public Const MIDIERR_NOMAP = (MIDIERR_BASE + 2)            '  no current map
Public Const MIDIERR_NOTREADY = (MIDIERR_BASE + 3)         '  hardware is still busy
Public Const MIDIERR_NODEVICE = (MIDIERR_BASE + 4)         '  port no longer connected
Public Const MIDIERR_INVALIDSETUP = (MIDIERR_BASE + 5)     '  invalid setup
Public Const MIDIERR_LASTERROR = (MIDIERR_BASE + 5)        '  last error in range

Public Const MIDIPATCHSIZE = 128

'  MIDI callback messages
Public Const MIM_OPEN = MM_MIM_OPEN
Public Const MIM_CLOSE = MM_MIM_CLOSE
Public Const MIM_DATA = MM_MIM_DATA
Public Const MIM_LONGDATA = MM_MIM_LONGDATA
Public Const MIM_ERROR = MM_MIM_ERROR
Public Const MIM_LONGERROR = MM_MIM_LONGERROR
Public Const MOM_OPEN = MM_MOM_OPEN
Public Const MOM_CLOSE = MM_MOM_CLOSE
Public Const MOM_DONE = MM_MOM_DONE

'  device ID for MIDI mapper
Public Const MIDIMAPPER = (-1)
Public Const MIDI_MAPPER = (-1)

'  flags for wFlags parm of midiOutCachePatches(), midiOutCacheDrumPatches()
Public Const MIDI_CACHE_ALL = 1
Public Const MIDI_CACHE_BESTFIT = 2
Public Const MIDI_CACHE_QUERY = 3
Public Const MIDI_UNCACHE = 4

'  MIDI output device capabilities structure
Type MIDIOUTCAPS
    wMid As Integer                  '  manufacturer ID
    wPid As Integer                  '  product ID
    vDriverVersion As Integer        '  version of the driver
    szPname As String * MAXPNAMELEN  '  product name (NULL terminated string)
    wTechnology As Integer           '  type of device
    wVoices As Integer               '  # of voices (internal synth only)
    wNotes As Integer                '  max # of notes (internal synth only)
    wChannelMask As Integer          '  channels used (internal synth only)
    dwSupport As Long             '  functionality supported by driver
End Type

'  flags for wTechnology field of MIDIOUTCAPS structure
Public Const MOD_MIDIPORT = 1      '  output port
Public Const MOD_SYNTH = 2         '  generic internal synth
Public Const MOD_SQSYNTH = 3       '  square wave internal synth
Public Const MOD_FMSYNTH = 4       '  FM internal synth
Public Const MOD_MAPPER = 5        '  MIDI mapper

'  flags for dwSupport field of MIDIOUTCAPS structure
Public Const MIDICAPS_VOLUME = &H1               '  supports volume control
Public Const MIDICAPS_LRVOLUME = &H2             '  separate left-right volume control
Public Const MIDICAPS_CACHE = &H4

'  MIDI output device capabilities structure
Type MIDIINCAPS
    wMid As Integer                  '  manufacturer ID
    wPid As Integer                  '  product ID
    vDriverVersion As Integer        '  version of the driver
    szPname As String * MAXPNAMELEN  '  product name (NULL terminated string)
End Type

'  MIDI data block header
Type MIDIHDR
    lpData As Long               '  pointer to locked data block
    dwBufferLength As Long       '  length of data in data block
    dwBytesRecorded As Long      '  used for input only
    dwUser As Long               '  for client's use
    dwFlags As Long              '  assorted flags (see defines)
    midihdr_tag As Long          '  reserved for driver
    reserved As Long             '  reserved for driver
End Type

'  flags for dwFlags field of MIDIHDR structure
Public Const MHDR_DONE = &H1                     '  done bit
Public Const MHDR_PREPARED = &H2                 '  set if header prepared
Public Const MHDR_INQUEUE = &H4                  '  reserved for driver

'  MIDI function prototypes
Declare Function midiOutGetNumDevs Lib "MMSYSTEM" () As Integer
Declare Function midiOutGetDevCaps Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpCaps As MIDIOUTCAPS, ByVal uSize As Integer) As Integer
Declare Function midiOutGetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpdwvolume As Long) As Integer
Declare Function midiOutSetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, ByVal dwVolume As Long) As Integer
Declare Function midiOutGetErrorText Lib "MMSYSTEM" (ByVal uError As Integer, ByVal lpText As String, ByVal uSize As Integer) As Integer
Declare Function midiOutOpen Lib "MMSYSTEM" (lphMidiOut As Integer, ByVal udeviceid As Integer, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal dwFlags As Long) As Integer
Declare Function midiOutClose Lib "MMSYSTEM" (ByVal hMidiOut As Integer) As Integer
Declare Function midiOutPrepareHeader Lib "MMSYSTEM" (ByVal hMidiOut As Integer, lphMidiOut As MIDIHDR, ByVal uSize As Integer) As Integer
Declare Function midiOutUnprepareHeader Lib "MMSYSTEM" (ByVal hMidiOut As Integer, lphMidiOut As MIDIHDR, ByVal uSize As Integer) As Integer
Declare Function midiOutShortMsg Lib "MMSYSTEM" (ByVal hMidiOut As Integer, ByVal dwMsg As Long) As Integer
Declare Function midiOutLongMsg Lib "MMSYSTEM" (ByVal hMidiOut As Integer, lphMidiOut As MIDIHDR, ByVal uSize As Integer) As Integer
Declare Function midiOutReset Lib "MMSYSTEM" (ByVal hMidiOut As Integer) As Integer
Declare Function midiOutCachePatches Lib "MMSYSTEM" (ByVal hMidiOut As Integer, ByVal uBank As Integer, ByVal PatchArray As Long, ByVal uFlags As Integer) As Integer
Declare Function midiOutCacheDrumPatches Lib "MMSYSTEM" (ByVal hMidiOut As Integer, ByVal uPatch As Integer, lpwKeyArray As Integer, ByVal uFlags As Integer) As Integer
Declare Function midiOutGetID Lib "MMSYSTEM" (ByVal hMidiOut As Integer, lpudeviceid As Integer) As Integer
Declare Function midiOutMessage Lib "MMSYSTEM" (ByVal hMidiOut As Integer, ByVal uMessage As Integer, ByVal dw1 As Long, ByVal dw2 As Long) As Long
Declare Function midiInGetNumDevs Lib "MMSYSTEM" () As Integer
Declare Function midiInGetDevCaps Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpCaps As MIDIINCAPS, ByVal uSize As Integer) As Integer
Declare Function midiInGetErrorText Lib "MMSYSTEM" (ByVal uError As Integer, ByVal lpText As String, ByVal uSize As Integer) As Integer
Declare Function midiInOpen Lib "MMSYSTEM" (lphMidiIn As Integer, ByVal udeviceid As Integer, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal dwFlags As Long) As Integer
Declare Function midiInClose Lib "MMSYSTEM" (ByVal hMidiIn As Integer) As Integer
Declare Function midiInPrepareHeader Lib "MMSYSTEM" (ByVal hMidiIn As Integer, lpMidiInHdr As MIDIHDR, ByVal uSize As Integer) As Integer
Declare Function midiInUnprepareHeader Lib "MMSYSTEM" (ByVal hMidiIn As Integer, lpMidiInHdr As MIDIHDR, ByVal uSize As Integer) As Integer
Declare Function midiInAddBuffer Lib "MMSYSTEM" (ByVal hMidiIn As Integer, lpMidiInHdr As MIDIHDR, ByVal uSize As Integer) As Integer
Declare Function midiInStart Lib "MMSYSTEM" (ByVal hMidiIn As Integer) As Integer
Declare Function midiInStop Lib "MMSYSTEM" (ByVal hMidiIn As Integer) As Integer
Declare Function midiInReset Lib "MMSYSTEM" (ByVal hMidiIn As Integer) As Integer
Declare Function midiInGetID Lib "MMSYSTEM" (ByVal hMidiIn As Integer, lpudeviceid As Integer) As Integer
Declare Function midiInMessage Lib "MMSYSTEM" (ByVal hMidiIn As Integer, ByVal uMessage As Integer, ByVal dw1 As Long, ByVal dw2 As Long) As Long


' ***************************************************************************

'                         Auxiliary audio support

' ****************************************************************************/

'  device ID for aux device mapper
Public Const AUX_MAPPER = (-1)

'  Auxiliary audio device capabilities structure
Type AUXCAPS
    wMid As Integer                  '  manufacturer ID
    wPid As Integer                  '  product ID
    vDriverVersion As Integer        '  version of the driver
    szPname As String * MAXPNAMELEN  '  product name (NULL terminated string)
    wTechnology As Integer           '  type of device
    dwSupport As Long             '  functionality supported by driver
End Type
' typedef AUXCAPS       *PAUXCAPS;
' typedef AUXCAPS NEAR *NPAUXCAPS;
' typedef AUXCAPS FAR  *LPAUXCAPS;

'  flags for wTechnology field in AUXCAPS structure
Public Const AUXCAPS_CDAUDIO = 1           '  audio from internal CD-ROM drive
Public Const AUXCAPS_AUXIN = 2             '  audio from auxiliary input jacks

'  flags for dwSupport field in AUXCAPS structure
Public Const AUXCAPS_VOLUME = &H1               '  supports volume control
Public Const AUXCAPS_LRVOLUME = &H2             '  separate left-right volume control

'  auxiliary audio function prototypes
Declare Function auxGetNumDevs Lib "MMSYSTEM" () As Integer
Declare Function auxGetDevCaps Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpCaps As AUXCAPS, ByVal uSize As Integer) As Integer
Declare Function auxSetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, ByVal dwVolume As Long) As Integer
Declare Function auxGetVolume Lib "MMSYSTEM" (ByVal udeviceid As Integer, lpdwvolume As Long) As Integer
Declare Function auxOutMessage Lib "MMSYSTEM" (ByVal udeviceid As Integer, ByVal uMessage As Integer, ByVal dw1 As Long, ByVal dw2 As Long) As Long


' ***************************************************************************

'                             Timer support

' ****************************************************************************/

'  timer error return values
Public Const TIMERR_NOERROR = (0)                          '  no error
Public Const TIMERR_NOCANDO = (TIMERR_BASE + 1)            '  request not completed
Public Const TIMERR_STRUCT = (TIMERR_BASE + 33)            '  time struct size

'  flags for wFlags parameter of timeSetEvent() function
Public Const TIME_ONESHOT = 0       '  program timer for single event
Public Const TIME_PERIODIC = 1      '  program for continuous periodic event

'  timer device capabilities data structure
Type TIMECAPS
    wPeriodMin As Integer     '  minimum period supported
    wPeriodMax As Integer     '  maximum period supported
End Type

'  timer function prototypes
Declare Function timeGetSystemTime Lib "MMSYSTEM" (lpTime As MMTIME, ByVal uSize As Integer) As Integer
Declare Function timeGetTime Lib "MMSYSTEM" () As Long
Declare Function timeKillEvent Lib "MMSYSTEM" (ByVal uTimerID As Integer) As Integer
Declare Function timeGetDevCaps Lib "MMSYSTEM" (lpTimeCaps As TIMECAPS, ByVal uSize As Integer) As Integer
Declare Function timeBeginPeriod Lib "MMSYSTEM" (ByVal uPeriod As Integer) As Integer
Declare Function timeEndPeriod Lib "MMSYSTEM" (ByVal uPeriod As Integer) As Integer



' ***************************************************************************

'                             Joystick support

' ****************************************************************************/

'  joystick error return values
Public Const JOYERR_NOERROR = (0)                          '  no error
Public Const JOYERR_PARMS = (JOYERR_BASE + 5)              '  bad parameters
Public Const JOYERR_NOCANDO = (JOYERR_BASE + 6)            '  request not completed
Public Const JOYERR_UNPLUGGED = (JOYERR_BASE + 7)          '  joystick is unplugged

'  constants used with JOYINFO structure and MM_JOY* messages
Public Const JOY_BUTTON1 = &H1
Public Const JOY_BUTTON2 = &H2
Public Const JOY_BUTTON3 = &H4
Public Const JOY_BUTTON4 = &H8
Public Const JOY_BUTTON1CHG = &H100
Public Const JOY_BUTTON2CHG = &H200
Public Const JOY_BUTTON3CHG = &H400
Public Const JOY_BUTTON4CHG = &H800

'  joystick ID constants
Public Const JOYSTICKID1 = 0
Public Const JOYSTICKID2 = 1

'  joystick device capabilities data structure
Type JOYCAPS
    wMid As Integer                  '  manufacturer ID
    wPid As Integer                  '  product ID
    szPname As String * MAXPNAMELEN  '  product name (NULL terminated string)
    wXmin As Integer                 '  minimum x position value
    wXmax As Integer                 '  maximum x position value
    wYmin As Integer                 '  minimum y position value
    wYmax As Integer                 '  maximum y position value
    wZmin As Integer                 '  minimum z position value
    wZmax As Integer                 '  maximum z position value
    wNumButtons As Integer           '  number of buttons
    wPeriodMin As Integer            '  minimum message period when captured
    wPeriodMax As Integer            '  maximum message period when captured
End Type

'  joystick information data structure
Type JOYINFO
    wXpos As Integer                 '  x position
    wYpos As Integer                 '  y position
    wZpos As Integer                 '  z position
    wButtons As Integer              '  button states
End Type

'  joystick function prototypes
Declare Function joyGetDevCaps Lib "MMSYSTEM" (ByVal uJoyID As Integer, lpCaps As JOYCAPS, ByVal uSize As Integer) As Integer
Declare Function joyGetNumDevs Lib "MMSYSTEM" () As Integer
Declare Function joyGetPos Lib "MMSYSTEM" (ByVal uJoyID As Integer, lpCaps As JOYINFO) As Integer
Declare Function joyGetThreshold Lib "MMSYSTEM" (ByVal uJoyID As Integer, lputhreshold As Integer) As Integer
Declare Function joyReleaseCapture Lib "MMSYSTEM" (ByVal uJoyID As Integer) As Integer
Declare Function joySetCapture Lib "MMSYSTEM" (ByVal hWnd As Integer, ByVal uJoyID As Integer, ByVal uPeriod As Integer, ByVal bChanged As Integer) As Integer
Declare Function joySetThreshold Lib "MMSYSTEM" (ByVal uJoyID As Integer, ByVal uThreshold As Integer) As Integer

' ***************************************************************************

'                         Multimedia File I/O support

' ****************************************************************************/

'  MMIO error return values
Public Const MMIOERR_BASE = 256
Public Const MMIOERR_FILENOTFOUND = (MMIOERR_BASE + 1)      '  file not found
Public Const MMIOERR_OUTOFMEMORY = (MMIOERR_BASE + 2)       '  out of memory
Public Const MMIOERR_CANNOTOPEN = (MMIOERR_BASE + 3)        '  cannot open
Public Const MMIOERR_CANNOTCLOSE = (MMIOERR_BASE + 4)       '  cannot close
Public Const MMIOERR_CANNOTREAD = (MMIOERR_BASE + 5)        '  cannot read
Public Const MMIOERR_CANNOTWRITE = (MMIOERR_BASE + 6)       '  cannot write
Public Const MMIOERR_CANNOTSEEK = (MMIOERR_BASE + 7)        '  cannot seek
Public Const MMIOERR_CANNOTEXPAND = (MMIOERR_BASE + 8)      '  cannot expand file
Public Const MMIOERR_CHUNKNOTFOUND = (MMIOERR_BASE + 9)     '  chunk not found
Public Const MMIOERR_UNBUFFERED = (MMIOERR_BASE + 10)       '  file is unbuffered

'  MMIO constants
Public Const CFSEPCHAR = "+"    '  compound file name separator char.

'  MMIO data types

'  general MMIO information data structure
Type MMIOINFO
    '  general fields
    dwFlags As Long        '  general status flags
    fccIOProc As Long      '  pointer to I/O procedure
    pIOProc As Long        '  pointer to I/O procedure
    wErrorRet As Integer   '  place for error to be returned
    HTASK As Integer         '  alternate local task

    '  fields maintained by MMIO functions during buffered I/O
    cchBuffer As Long      '  size of I/O buffer (or 0L)
    pchBuffer As String     '  start of I/O buffer (or NULL)
    pchNext As String       '  pointer to next byte to read/write
    pchEndRead As String    '  pointer to last valid byte to read
    pchEndWrite As String   '  pointer to last byte to write
    lBufOffset As Long     '  disk offset of start of buffer

    '  fields maintained by I/O procedure
    lDiskOffset As Long    '  disk offset of next read or write
    adwInfo(3) As Long     '  data specific to type of MMIOPROC

    '  other fields maintained by MMIO
    dwReserved1 As Long    '  reserved for MMIO use
    dwReserved2 As Long    '  reserved for MMIO use
    hmmio As Integer       '  handle to open file
End Type

'  RIFF chunk information data structure
Type MMCKINFO
    ckid As Long           '  chunk ID
    cksize As Long         '  chunk size
    fccType As Long        '  form type or list type
    dwDataOffset As Long   '  offset of data portion of chunk
    dwFlags As Long        '  flags used by MMIO functions
End Type

'  bit field masks
Public Const MMIO_RWMODE = &H3                  '  open file for reading/writing/both
Public Const MMIO_SHAREMODE = &H70              '  file sharing mode number

'  constants for dwFlags field of MMIOINFO
Public Const MMIO_CREATE = &H1000               '  create new file (or truncate file)
Public Const MMIO_PARSE = &H100                 '  parse new file returning path
Public Const MMIO_DELETE = &H200                '  create new file (or truncate file)
Public Const MMIO_EXIST = &H4000                '  checks for existence of file
Public Const MMIO_ALLOCBUF = &H10000            '  mmioOpen() should allocate a buffer
Public Const MMIO_GETTEMP = &H20000             '  mmioOpen() should retrieve temp name

Public Const MMIO_DIRTY = &H10000000            '  I/O buffer is dirty


'  read/write mode numbers (bit field MMIO_RWMODE)
Public Const MMIO_READ = &H0                    '  open file for reading only
Public Const MMIO_WRITE = &H1                   '  open file for writing only
Public Const MMIO_READWRITE = &H2               '  open file for reading and writing

'  share mode numbers (bit field MMIO_SHAREMODE)
Public Const MMIO_COMPAT = &H0                  '  compatibility mode
Public Const MMIO_EXCLUSIVE = &H10              '  exclusive-access mode
Public Const MMIO_DENYWRITE = &H20              '  deny writing to other processes
Public Const MMIO_DENYREAD = &H30               '  deny reading to other processes
Public Const MMIO_DENYNONE = &H40               '  deny nothing to other processes

'  various MMIO flags
Public Const MMIO_FHOPEN = &H10                 '  mmioClose: keep file handle open
Public Const MMIO_EMPTYBUF = &H10               '  mmioFlush: empty the I/O buffer
Public Const MMIO_TOUPPER = &H10                '  mmioStringToFOURCC: to u-case
Public Const MMIO_INSTALLPROC = &H10000         '  mmioInstallIOProc: install MMIOProc
Public Const MMIO_GLOBALPROC = &H10000000       '  mmioInstallIOProc: install globally
Public Const MMIO_REMOVEPROC = &H20000          '  mmioInstallIOProc: remove MMIOProc
Public Const MMIO_FINDPROC = &H40000            '  mmioInstallIOProc: find an MMIOProc
Public Const MMIO_FINDCHUNK = &H10              '  mmioDescend: find a chunk by ID
Public Const MMIO_FINDRIFF = &H20               '  mmioDescend: find a LIST chunk
Public Const MMIO_FINDLIST = &H40               '  mmioDescend: find a RIFF chunk
Public Const MMIO_CREATERIFF = &H20             '  mmioCreateChunk: make a LIST chunk
Public Const MMIO_CREATELIST = &H40             '  mmioCreateChunk: make a RIFF chunk


'  message numbers for MMIOPROC I/O procedure functions
Public Const MMIOM_READ = MMIO_READ             '  read
Public Const MMIOM_WRITE = MMIO_WRITE           '  write
Public Const MMIOM_SEEK = 2                     '  seek to a new position in file
Public Const MMIOM_OPEN = 3                     '  open file
Public Const MMIOM_CLOSE = 4                    '  close file
Public Const MMIOM_WRITEFLUSH = 5               '  write and flush

Public Const MMIOM_RENAME = 6                   '  rename specified file

Public Const MMIOM_USER = &H8000                '  beginning of user-defined messages

'  standard four character codes
Public Const FOURCC_RIFF = "RIFF"
Public Const FOURCC_LIST = "LIST"

'  four character codes used to identify standard built-in I/O procedures
Public Const FOURCC_DOS = "DOS "
Public Const FOURCC_MEM = "MEM "

'  flags for mmioSeek()
Public Const SEEK_SET = 0                       '  seek to an absolute position
Public Const SEEK_CUR = 1                       '  seek relative to current position
Public Const SEEK_END = 2                       '  seek relative to end of file

'  other constants
Public Const MMIO_DEFAULTBUFFER = 8192          '  default buffer size

'  MMIO function prototypes
Declare Function mmioStringToFOURCC Lib "mmsystem" (ByVal sz As String, ByVal uFlags As Integer) As Long
Declare Function mmioOpen Lib "mmsystem" (ByVal szFileName As String, mi As MMIOINFO, lpmmioinfo As MMIOINFO, ByVal dwOpenFlags As Long) As Integer
Declare Function mmioRename Lib "mmsystem" (ByVal szFileName As String, ByVal szNewFileName As String, lpmmioinfo As MMIOINFO, ByVal dwRenameFlags As Long) As Integer
Declare Function mmioClose Lib "mmsystem" (ByVal hmmio As Integer, ByVal uFlags As Integer) As Integer
Declare Function mmioRead Lib "mmsystem" (ByVal hmmio As Integer, ByVal pch As String, ByVal cch As Long) As Long
Declare Function mmioWrite Lib "mmsystem" (ByVal hmmio As Integer, ByVal pch As String, ByVal cch As Long) As Long
Declare Function mmioSeek Lib "mmsystem" (ByVal hmmio As Integer, ByVal lOffset As Long, ByVal iOrigin As Integer) As Long
Declare Function mmioGetInfo Lib "mmsystem" (ByVal hmmio As Integer, lpmmioinfo As MMIOINFO, ByVal uFlags As Integer) As Integer
Declare Function mmioSetInfo Lib "mmsystem" (ByVal hmmio As Integer, lpmmioinfo As MMIOINFO, ByVal uFlags As Integer) As Integer
Declare Function mmioSetBuffer Lib "mmsystem" (ByVal hmmio As Integer, ByVal pchBuffer As String, ByVal cchBuffer As Long, ByVal uFlags As Integer) As Integer
Declare Function mmioFlush Lib "mmsystem" (ByVal hmmio As Integer, ByVal uFlags As Integer) As Integer
Declare Function mmioAdvance Lib "mmsystem" (ByVal hmmio As Integer, lpmmioinfo As MMIOINFO, ByVal uFlags As Integer) As Integer
Declare Function mmioSendMessage Lib "mmsystem" (ByVal hmmio As Integer, ByVal uMessage As Integer, ByVal lParam1 As Long, ByVal lParam2 As Long) As Long
Declare Function mmioDescend Lib "mmsystem" (ByVal hmmio As Integer, lpck As MMCKINFO, lpckParent As MMCKINFO, ByVal uFlags As Integer) As Integer
Declare Function mmioAscend Lib "mmsystem" (ByVal hmmio As Integer, lpck As MMCKINFO, ByVal uFlags As Integer) As Integer
Declare Function mmioCreateChunk Lib "mmsystem" (ByVal hmmio As Integer, lpck As MMCKINFO, ByVal uFlags As Integer) As Integer


' ***************************************************************************

'                             MCI support

' ****************************************************************************/


'  MCI function prototypes
Declare Function mciSendCommand Lib "mmsystem" (ByVal udeviceid As Integer, ByVal uMessage As Integer, ByVal dwParam1 As Long, ByVal dwParam2 As Long) As Long
Declare Function mciSendString Lib "mmsystem" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hWndCallback As Integer) As Long
Declare Function mciGetDeviceID Lib "mmsystem" (ByVal lpstrName As String) As Integer
Declare Function mciGetDeviceIDFromElementID Lib "mmsystem" (ByVal dwElementID As Long, ByVal lpstrType As String) As Integer
Declare Function mciGetErrorString Lib "mmsystem" (ByVal wError As Long, ByVal lpstrBuffer As String, ByVal uLength As Integer) As Integer
Declare Function mciGetCreatorTask Lib "mmsystem" (ByVal udeviceid As Integer) As Integer
Declare Function mciExecute Lib "mmsystem" (ByVal lpstrCommand As String) As Integer

'  MCI error return values
Public Const MCIERR_INVALID_DEVICE_ID = (MCIERR_BASE + 1)
Public Const MCIERR_UNRECOGNIZED_KEYWORD = (MCIERR_BASE + 3)
Public Const MCIERR_UNRECOGNIZED_COMMAND = (MCIERR_BASE + 5)
Public Const MCIERR_HARDWARE = (MCIERR_BASE + 6)
Public Const MCIERR_INVALID_DEVICE_NAME = (MCIERR_BASE + 7)
Public Const MCIERR_OUT_OF_MEMORY = (MCIERR_BASE + 8)
Public Const MCIERR_DEVICE_OPEN = (MCIERR_BASE + 9)
Public Const MCIERR_CANNOT_LOAD_DRIVER = (MCIERR_BASE + 10)
Public Const MCIERR_MISSING_COMMAND_STRING = (MCIERR_BASE + 11)
Public Const MCIERR_PARAM_OVERFLOW = (MCIERR_BASE + 12)
Public Const MCIERR_MISSING_STRING_ARGUMENT = (MCIERR_BASE + 13)
Public Const MCIERR_BAD_INTEGER = (MCIERR_BASE + 14)
Public Const MCIERR_PARSER_INTERNAL = (MCIERR_BASE + 15)
Public Const MCIERR_DRIVER_INTERNAL = (MCIERR_BASE + 16)
Public Const MCIERR_MISSING_PARAMETER = (MCIERR_BASE + 17)
Public Const MCIERR_UNSUPPORTED_FUNCTION = (MCIERR_BASE + 18)
Public Const MCIERR_FILE_NOT_FOUND = (MCIERR_BASE + 19)
Public Const MCIERR_DEVICE_NOT_READY = (MCIERR_BASE + 20)
Public Const MCIERR_INTERNAL = (MCIERR_BASE + 21)
Public Const MCIERR_DRIVER = (MCIERR_BASE + 22)
Public Const MCIERR_CANNOT_USE_ALL = (MCIERR_BASE + 23)
Public Const MCIERR_MULTIPLE = (MCIERR_BASE + 24)
Public Const MCIERR_EXTENSION_NOT_FOUND = (MCIERR_BASE + 25)
Public Const MCIERR_OUTOFRANGE = (MCIERR_BASE + 26)
Public Const MCIERR_FLAGS_NOT_COMPATIBLE = (MCIERR_BASE + 28)
Public Const MCIERR_FILE_NOT_SAVED = (MCIERR_BASE + 30)
Public Const MCIERR_DEVICE_TYPE_REQUIRED = (MCIERR_BASE + 31)
Public Const MCIERR_DEVICE_LOCKED = (MCIERR_BASE + 32)
Public Const MCIERR_DUPLICATE_ALIAS = (MCIERR_BASE + 33)
Public Const MCIERR_BAD_CONSTANT = (MCIERR_BASE + 34)
Public Const MCIERR_MUST_USE_SHAREABLE = (MCIERR_BASE + 35)
Public Const MCIERR_MISSING_DEVICE_NAME = (MCIERR_BASE + 36)
Public Const MCIERR_BAD_TIME_FORMAT = (MCIERR_BASE + 37)
Public Const MCIERR_NO_CLOSING_QUOTE = (MCIERR_BASE + 38)
Public Const MCIERR_DUPLICATE_FLAGS = (MCIERR_BASE + 39)
Public Const MCIERR_INVALID_FILE = (MCIERR_BASE + 40)
Public Const MCIERR_NULL_PARAMETER_BLOCK = (MCIERR_BASE + 41)
Public Const MCIERR_UNNAMED_RESOURCE = (MCIERR_BASE + 42)
Public Const MCIERR_NEW_REQUIRES_ALIAS = (MCIERR_BASE + 43)
Public Const MCIERR_NOTIFY_ON_AUTO_OPEN = (MCIERR_BASE + 44)
Public Const MCIERR_NO_ELEMENT_ALLOWED = (MCIERR_BASE + 45)
Public Const MCIERR_NONAPPLICABLE_FUNCTION = (MCIERR_BASE + 46)
Public Const MCIERR_ILLEGAL_FOR_AUTO_OPEN = (MCIERR_BASE + 47)
Public Const MCIERR_FILENAME_REQUIRED = (MCIERR_BASE + 48)
Public Const MCIERR_EXTRA_CHARACTERS = (MCIERR_BASE + 49)
Public Const MCIERR_DEVICE_NOT_INSTALLED = (MCIERR_BASE + 50)
Public Const MCIERR_GET_CD = (MCIERR_BASE + 51)
Public Const MCIERR_SET_CD = (MCIERR_BASE + 52)
Public Const MCIERR_SET_DRIVE = (MCIERR_BASE + 53)
Public Const MCIERR_DEVICE_LENGTH = (MCIERR_BASE + 54)
Public Const MCIERR_DEVICE_ORD_LENGTH = (MCIERR_BASE + 55)
Public Const MCIERR_NO_INTEGER = (MCIERR_BASE + 56)
Public Const MCIERR_WAVE_OUTPUTSINUSE = (MCIERR_BASE + 64)
Public Const MCIERR_WAVE_SETOUTPUTINUSE = (MCIERR_BASE + 65)
Public Const MCIERR_WAVE_INPUTSINUSE = (MCIERR_BASE + 66)
Public Const MCIERR_WAVE_SETINPUTINUSE = (MCIERR_BASE + 67)
Public Const MCIERR_WAVE_OUTPUTUNSPECIFIED = (MCIERR_BASE + 68)
Public Const MCIERR_WAVE_INPUTUNSPECIFIED = (MCIERR_BASE + 69)
Public Const MCIERR_WAVE_OUTPUTSUNSUITABLE = (MCIERR_BASE + 70)
Public Const MCIERR_WAVE_SETOUTPUTUNSUITABLE = (MCIERR_BASE + 71)
Public Const MCIERR_WAVE_INPUTSUNSUITABLE = (MCIERR_BASE + 72)
Public Const MCIERR_WAVE_SETINPUTUNSUITABLE = (MCIERR_BASE + 73)
Public Const MCIERR_SEQ_DIV_INCOMPATIBLE = (MCIERR_BASE + 80)
Public Const MCIERR_SEQ_PORT_INUSE = (MCIERR_BASE + 81)
Public Const MCIERR_SEQ_PORT_NONEXISTENT = (MCIERR_BASE + 82)
Public Const MCIERR_SEQ_PORT_MAPNODEVICE = (MCIERR_BASE + 83)
Public Const MCIERR_SEQ_PORT_MISCERROR = (MCIERR_BASE + 84)
Public Const MCIERR_SEQ_TIMER = (MCIERR_BASE + 85)
Public Const MCIERR_SEQ_PORTUNSPECIFIED = (MCIERR_BASE + 86)
Public Const MCIERR_SEQ_NOMIDIPRESENT = (MCIERR_BASE + 87)
Public Const MCIERR_NO_WINDOW = (MCIERR_BASE + 90)
Public Const MCIERR_CREATEWINDOW = (MCIERR_BASE + 91)
Public Const MCIERR_FILE_READ = (MCIERR_BASE + 92)
Public Const MCIERR_FILE_WRITE = (MCIERR_BASE + 93)

'  all custom device driver errors must be >= than this value
Public Const MCIERR_CUSTOM_DRIVER_BASE = (MCIERR_BASE + 256)

'  MCI command message identifiers
Public Const MCI_OPEN = &H803
Public Const MCI_CLOSE = &H804
Public Const MCI_ESCAPE = &H805
Public Const MCI_PLAY = &H806
Public Const MCI_SEEK = &H807
Public Const MCI_STOP = &H808
Public Const MCI_PAUSE = &H809
Public Const MCI_INFO = &H80A
Public Const MCI_GETDEVCAPS = &H80B
Public Const MCI_SPIN = &H80C
Public Const MCI_SET = &H80D
Public Const MCI_STEP = &H80E
Public Const MCI_RECORD = &H80F
Public Const MCI_SYSINFO = &H810
Public Const MCI_BREAK = &H811
Public Const MCI_SOUND = &H812
Public Const MCI_SAVE = &H813
Public Const MCI_STATUS = &H814
Public Const MCI_CUE = &H830
Public Const MCI_REALIZE = &H840
Public Const MCI_WINDOW = &H841
Public Const MCI_PUT = &H842
Public Const MCI_WHERE = &H843
Public Const MCI_FREEZE = &H844
Public Const MCI_UNFREEZE = &H845
Public Const MCI_LOAD = &H850
Public Const MCI_CUT = &H851
Public Const MCI_COPY = &H852
Public Const MCI_PASTE = &H853
Public Const MCI_UPDATE = &H854
Public Const MCI_RESUME = &H855
Public Const MCI_DELETE = &H856

'  device ID for "all devices"
Public Const MCI_ALL_DEVICE_ID = &HFFFF

'  constants for predefined MCI device types
Public Const MCI_DEVTYPE_VCR = (MCI_STRING_OFFSET + 1)
Public Const MCI_DEVTYPE_VIDEODISC = (MCI_STRING_OFFSET + 2)
Public Const MCI_DEVTYPE_OVERLAY = (MCI_STRING_OFFSET + 3)
Public Const MCI_DEVTYPE_CD_AUDIO = (MCI_STRING_OFFSET + 4)
Public Const MCI_DEVTYPE_DAT = (MCI_STRING_OFFSET + 5)
Public Const MCI_DEVTYPE_SCANNER = (MCI_STRING_OFFSET + 6)
Public Const MCI_DEVTYPE_ANIMATION = (MCI_STRING_OFFSET + 7)
Public Const MCI_DEVTYPE_DIGITAL_VIDEO = (MCI_STRING_OFFSET + 8)
Public Const MCI_DEVTYPE_OTHER = (MCI_STRING_OFFSET + 9)
Public Const MCI_DEVTYPE_WAVEFORM_AUDIO = (MCI_STRING_OFFSET + 10)
Public Const MCI_DEVTYPE_SEQUENCER = (MCI_STRING_OFFSET + 11)

Public Const MCI_DEVTYPE_FIRST = MCI_DEVTYPE_VCR
Public Const MCI_DEVTYPE_LAST = MCI_DEVTYPE_SEQUENCER

'  return values for 'status mode' command
Public Const MCI_MODE_NOT_READY = (MCI_STRING_OFFSET + 12)
Public Const MCI_MODE_STOP = (MCI_STRING_OFFSET + 13)
Public Const MCI_MODE_PLAY = (MCI_STRING_OFFSET + 14)
Public Const MCI_MODE_RECORD = (MCI_STRING_OFFSET + 15)
Public Const MCI_MODE_SEEK = (MCI_STRING_OFFSET + 16)
Public Const MCI_MODE_PAUSE = (MCI_STRING_OFFSET + 17)
Public Const MCI_MODE_OPEN = (MCI_STRING_OFFSET + 18)

'  constants used in 'set time format' and 'status time format' commands
Public Const MCI_FORMAT_MILLISECONDS = 0
Public Const MCI_FORMAT_HMS = 1
Public Const MCI_FORMAT_MSF = 2
Public Const MCI_FORMAT_FRAMES = 3
Public Const MCI_FORMAT_SMPTE_24 = 4
Public Const MCI_FORMAT_SMPTE_25 = 5
Public Const MCI_FORMAT_SMPTE_30 = 6
Public Const MCI_FORMAT_SMPTE_30DROP = 7
Public Const MCI_FORMAT_BYTES = 8
Public Const MCI_FORMAT_SAMPLES = 9
Public Const MCI_FORMAT_TMSF = 10

'  MCI time format conversion macros

'  flags for wParam of MM_MCINOTIFY message
Public Const MCI_NOTIFY_SUCCESSFUL = &H1
Public Const MCI_NOTIFY_SUPERSEDED = &H2
Public Const MCI_NOTIFY_ABORTED = &H4
Public Const MCI_NOTIFY_FAILURE = &H8


'  common flags for dwFlags parameter of MCI command messages
Public Const MCI_NOTIFY = &H1&
Public Const MCI_WAIT = &H2&
Public Const MCI_FROM = &H4&
Public Const MCI_TO = &H8&
Public Const MCI_TRACK = &H10&

'  flags for dwFlags parameter of MCI_OPEN command message
Public Const MCI_OPEN_SHAREABLE = &H100&
Public Const MCI_OPEN_ELEMENT = &H200&
Public Const MCI_OPEN_ALIAS = &H400&
Public Const MCI_OPEN_ELEMENT_ID = &H800&
Public Const MCI_OPEN_TYPE_ID = &H1000&
Public Const MCI_OPEN_TYPE = &H2000&

'  flags for dwFlags parameter of MCI_SEEK command message
Public Const MCI_SEEK_TO_START = &H100&
Public Const MCI_SEEK_TO_END = &H200&

'  flags for dwFlags parameter of MCI_STATUS command message
Public Const MCI_STATUS_ITEM = &H100&
Public Const MCI_STATUS_START = &H200&

'  flags for dwItem field of the MCI_STATUS_PARMS parameter block
Public Const MCI_STATUS_LENGTH = &H1&
Public Const MCI_STATUS_POSITION = &H2&
Public Const MCI_STATUS_NUMBER_OF_TRACKS = &H3&
Public Const MCI_STATUS_MODE = &H4&
Public Const MCI_STATUS_MEDIA_PRESENT = &H5&
Public Const MCI_STATUS_TIME_FORMAT = &H6&
Public Const MCI_STATUS_READY = &H7&
Public Const MCI_STATUS_CURRENT_TRACK = &H8&

'  flags for dwFlags parameter of MCI_INFO command message
Public Const MCI_INFO_PRODUCT = &H100&
Public Const MCI_INFO_FILE = &H200&

'  flags for dwFlags parameter of MCI_GETDEVCAPS command message
Public Const MCI_GETDEVCAPS_ITEM = &H100&

'  flags for dwItem field of the MCI_GETDEVCAPS_PARMS parameter block
Public Const MCI_GETDEVCAPS_CAN_RECORD = &H1&
Public Const MCI_GETDEVCAPS_HAS_AUDIO = &H2&
Public Const MCI_GETDEVCAPS_HAS_VIDEO = &H3&
Public Const MCI_GETDEVCAPS_DEVICE_TYPE = &H4&
Public Const MCI_GETDEVCAPS_USES_FILES = &H5&
Public Const MCI_GETDEVCAPS_COMPOUND_DEVICE = &H6&
Public Const MCI_GETDEVCAPS_CAN_EJECT = &H7&
Public Const MCI_GETDEVCAPS_CAN_PLAY = &H8&
Public Const MCI_GETDEVCAPS_CAN_SAVE = &H9&

'  flags for dwFlags parameter of MCI_SYSINFO command message
Public Const MCI_SYSINFO_QUANTITY = &H100&
Public Const MCI_SYSINFO_OPEN = &H200&
Public Const MCI_SYSINFO_NAME = &H400&
Public Const MCI_SYSINFO_INSTALLNAME = &H800&

'  flags for dwFlags parameter of MCI_SET command message
Public Const MCI_SET_DOOR_OPEN = &H100&
Public Const MCI_SET_DOOR_CLOSED = &H200&
Public Const MCI_SET_TIME_FORMAT = &H400&
Public Const MCI_SET_AUDIO = &H800&
Public Const MCI_SET_VIDEO = &H1000&
Public Const MCI_SET_ON = &H2000&
Public Const MCI_SET_OFF = &H4000&

'  flags for dwAudio field of MCI_SET_PARMS or MCI_SEQ_SET_PARMS
Public Const MCI_SET_AUDIO_ALL = &H0&
Public Const MCI_SET_AUDIO_LEFT = &H1&
Public Const MCI_SET_AUDIO_RIGHT = &H2&

'  flags for dwFlags parameter of MCI_BREAK command message
Public Const MCI_BREAK_KEY = &H100&
Public Const MCI_BREAK_HWND = &H200&
Public Const MCI_BREAK_OFF = &H400&

'  flags for dwFlags parameter of MCI_RECORD command message
Public Const MCI_RECORD_INSERT = &H100&
Public Const MCI_RECORD_OVERWRITE = &H200&

'  flags for dwFlags parameter of MCI_SOUND command message
Public Const MCI_SOUND_NAME = &H100&

'  flags for dwFlags parameter of MCI_SAVE command message
Public Const MCI_SAVE_FILE = &H100&

'  flags for dwFlags parameter of MCI_LOAD command message
Public Const MCI_LOAD_FILE = &H100&

'  generic parameter block for MCI command messages with no special parameters
Type MCI_GENERIC_PARMS
	dwCallback As Long
End Type
' typedef MCI_GENERIC_PARMS FAR *LPMCI_GENERIC_PARMS;

'  parameter block for MCI_OPEN command message
Type MCI_OPEN_PARMS
    dwCallback As Long
    wDeviceID As Integer
    wReserved0 As Integer
    lpstrDeviceType As String
    lpstrElementName As String
    lpstrAlias As String
End Type

'  parameter block for MCI_PLAY command message
Type MCI_PLAY_PARMS
    dwCallback As Long
    dwFrom As Long
    dwTo As Long
End Type

'  parameter block for MCI_SEEK command message
Type MCI_SEEK_PARMS
    dwCallback As Long
    dwTo As Long
End Type

'  parameter block for MCI_STATUS command message
Type MCI_STATUS_PARMS
    dwCallback As Long
    dwReturn As Long
    dwItem As Long
    dwTrack As Long
End Type

'  parameter block for MCI_INFO command message
Type MCI_INFO_PARMS
    dwCallback As Long
    lpstrReturn As Long
    dwRetSize As Long
End Type

'  parameter block for MCI_GETDEVCAPS command message
Type MCI_GETDEVCAPS_PARMS
    dwCallback As Long
    dwReturn As Long
    dwItem As Long
End Type

'  parameter block for MCI_SYSINFO command message
Type MCI_SYSINFO_PARMS
    dwCallback As Long
    lpstrReturn As Long
    dwRetSize As Long
    dwNumber As Long
    wDeviceType As Integer
    wReserved0 As Integer
End Type

'  parameter block for MCI_SET command message
Type MCI_SET_PARMS
    dwCallback As Long
    dwTimeFormat As Long
    dwAudio As Long
End Type

'  parameter block for MCI_BREAK command message
Type MCI_BREAK_PARMS
    dwCallback As Long
    nVirtKey As Integer
    wReserved0 As Integer
    hwndBreak As Integer
    wReserved1 As Integer
End Type

'  parameter block for MCI_SOUND command message
Type MCI_SOUND_PARMS
    dwCallback As Long
    lpstrSoundName As String
End Type

'  parameter block for MCI_SAVE command message
Type MCI_SAVE_PARMS
    dwCallback As Long
    lpfilename As String
End Type

'  parameter block for MCI_LOAD command message
Type MCI_LOAD_PARMS
    dwCallback As Long
    lpfilename As String
End Type

'  parameter block for MCI_RECORD command message
Type MCI_RECORD_PARMS
    dwCallback As Long
    dwFrom As Long
    dwTo As Long
End Type


'  MCI extensions for videodisc devices

'  flag for dwReturn field of MCI_STATUS_PARMS
Public Const MCI_VD_MODE_PARK = (MCI_VD_OFFSET + 1)

'  flag for dwReturn field of MCI_STATUS_PARMS
Public Const MCI_VD_MEDIA_CLV = (MCI_VD_OFFSET + 2)
Public Const MCI_VD_MEDIA_CAV = (MCI_VD_OFFSET + 3)
Public Const MCI_VD_MEDIA_OTHER = (MCI_VD_OFFSET + 4)
Public Const MCI_VD_FORMAT_TRACK = &H4001

'  flags for dwFlags parameter of MCI_PLAY command message
Public Const MCI_VD_PLAY_REVERSE = &H10000
Public Const MCI_VD_PLAY_FAST = &H20000
Public Const MCI_VD_PLAY_SPEED = &H40000
Public Const MCI_VD_PLAY_SCAN = &H80000
Public Const MCI_VD_PLAY_SLOW = &H100000

'  flag for dwFlags parameter of MCI_SEEK command message
Public Const MCI_VD_SEEK_REVERSE = &H10000

'  flags for dwItem field of MCI_STATUS_PARMS parameter block
Public Const MCI_VD_STATUS_SPEED = &H4002&
Public Const MCI_VD_STATUS_FORWARD = &H4003&
Public Const MCI_VD_STATUS_MEDIA_TYPE = &H4004&
Public Const MCI_VD_STATUS_SIDE = &H4005&
Public Const MCI_VD_STATUS_DISC_SIZE = &H4006&

'  flags for dwFlags parameter of MCI_GETDEVCAPS command message
Public Const MCI_VD_GETDEVCAPS_CLV = &H10000
Public Const MCI_VD_GETDEVCAPS_CAV = &H20000

Public Const MCI_VD_SPIN_UP = &H10000
Public Const MCI_VD_SPIN_DOWN = &H20000

'  flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block
Public Const MCI_VD_GETDEVCAPS_CAN_REVERSE = &H4002&
Public Const MCI_VD_GETDEVCAPS_FAST_RATE = &H4003&
Public Const MCI_VD_GETDEVCAPS_SLOW_RATE = &H4004&
Public Const MCI_VD_GETDEVCAPS_NORMAL_RATE = &H4005&

'  flags for the dwFlags parameter of MCI_STEP command message
Public Const MCI_VD_STEP_FRAMES = &H10000
Public Const MCI_VD_STEP_REVERSE = &H20000

'  flag for the MCI_ESCAPE command message
Public Const MCI_VD_ESCAPE_STRING = &H100&

'  parameter block for MCI_PLAY command message
Type MCI_VD_PLAY_PARMS
    dwCallback As Long
    dwFrom As Long
    dwTo As Long
    dwSpeed As Long
End Type

'  parameter block for MCI_STEP command message
Type MCI_VD_STEP_PARMS
    dwCallback As Long
    dwFrames As Long
End Type

'  parameter block for MCI_ESCAPE command message
Type MCI_VD_ESCAPE_PARMS
    dwCallback As Long
    lpstrCommand As String
End Type


'  MCI extensions for waveform audio devices

'  flags for the dwFlags parameter of MCI_OPEN command message
Public Const MCI_WAVE_OPEN_BUFFER = &H10000

'  flags for the dwFlags parameter of MCI_SET command message
Public Const MCI_WAVE_SET_FORMATTAG = &H10000
Public Const MCI_WAVE_SET_CHANNELS = &H20000
Public Const MCI_WAVE_SET_SAMPLESPERSEC = &H40000
Public Const MCI_WAVE_SET_AVGBYTESPERSEC = &H80000
Public Const MCI_WAVE_SET_BLOCKALIGN = &H100000
Public Const MCI_WAVE_SET_BITSPERSAMPLE = &H200000

'  flags for the dwFlags parameter of MCI_STATUS, MCI_SET command messages
Public Const MCI_WAVE_INPUT = &H400000
Public Const MCI_WAVE_OUTPUT = &H800000

'  flags for the dwItem field of MCI_STATUS_PARMS parameter block
Public Const MCI_WAVE_STATUS_FORMATTAG = &H4001&
Public Const MCI_WAVE_STATUS_CHANNELS = &H4002&
Public Const MCI_WAVE_STATUS_SAMPLESPERSEC = &H4003&
Public Const MCI_WAVE_STATUS_AVGBYTESPERSEC = &H4004&
Public Const MCI_WAVE_STATUS_BLOCKALIGN = &H4005&
Public Const MCI_WAVE_STATUS_BITSPERSAMPLE = &H4006&
Public Const MCI_WAVE_STATUS_LEVEL = &H4007&

'  flags for the dwFlags parameter of MCI_SET command message
Public Const MCI_WAVE_SET_ANYINPUT = &H4000000
Public Const MCI_WAVE_SET_ANYOUTPUT = &H8000000

'  flags for the dwFlags parameter of MCI_GETDEVCAPS command message
Public Const MCI_WAVE_GETDEVCAPS_INPUTS = &H4001&
Public Const MCI_WAVE_GETDEVCAPS_OUTPUTS = &H4002&

'  parameter block for MCI_OPEN command message
Type MCI_WAVE_OPEN_PARMS
    dwCallback As Long
    wDeviceID As Integer
    wReserved0 As Integer
    lpstrDeviceType As String
    lpstrElementName As String
    lpstrAlias As String
    dwBufferSeconds As Long
End Type

'  parameter block for MCI_DELETE command message
Type MCI_WAVE_DELETE_PARMS
    dwCallback As Long
    dwFrom As Long
    dwTo As Long
End Type
' typedef MCI_WAVE_DELETE_PARMS FAR *LPMCI_WAVE_DELETE_PARMS;

'  parameter block for MCI_SET command message
Type MCI_WAVE_SET_PARMS
    dwCallback As Long
    dwTimeFormat As Long
    dwAudio As Long
    wInput As Integer
    wReserved0 As Integer
    wOutput As Integer
    wReserved1 As Integer
    wFormatTag As Integer
    wReserved2 As Integer
    nChannels As Integer
    wReserved3 As Integer
    nSamplesPerSec As Long
    nAvgBytesPerSec As Long
    nBlockAlign As Integer
    wReserved4 As Integer
    wBitsPerSample As Integer
    wReserved5 As Integer
End Type


'  MCI extensions for MIDI sequencer devices

'  flags for the dwReturn field of MCI_STATUS_PARMS parameter block
Public Const MCI_SEQ_DIV_PPQN = (0 + MCI_SEQ_OFFSET)
Public Const MCI_SEQ_DIV_SMPTE_24 = (1 + MCI_SEQ_OFFSET)
Public Const MCI_SEQ_DIV_SMPTE_25 = (2 + MCI_SEQ_OFFSET)
Public Const MCI_SEQ_DIV_SMPTE_30DROP = (3 + MCI_SEQ_OFFSET)
Public Const MCI_SEQ_DIV_SMPTE_30 = (4 + MCI_SEQ_OFFSET)

'  flags for the dwMaster field of MCI_SEQ_SET_PARMS parameter block
Public Const MCI_SEQ_FORMAT_SONGPTR = &H4001
Public Const MCI_SEQ_FILE = &H4002
Public Const MCI_SEQ_MIDI = &H4003
Public Const MCI_SEQ_SMPTE = &H4004
Public Const MCI_SEQ_NONE = 65533

'  flags for the dwItem field of MCI_STATUS_PARMS parameter block
Public Const MCI_SEQ_STATUS_TEMPO = &H4002&
Public Const MCI_SEQ_STATUS_PORT = &H4003&
Public Const MCI_SEQ_STATUS_SLAVE = &H4007&
Public Const MCI_SEQ_STATUS_MASTER = &H4008&
Public Const MCI_SEQ_STATUS_OFFSET = &H4009&
Public Const MCI_SEQ_STATUS_DIVTYPE = &H400A&

'  flags for the dwFlags parameter of MCI_SET command message
Public Const MCI_SEQ_SET_TEMPO = &H10000
Public Const MCI_SEQ_SET_PORT = &H20000
Public Const MCI_SEQ_SET_SLAVE = &H40000
Public Const MCI_SEQ_SET_MASTER = &H80000
Public Const MCI_SEQ_SET_OFFSET = &H1000000

'  parameter block for MCI_SET command message
Type MCI_SEQ_SET_PARMS
    dwCallback As Long
    dwTimeFormat As Long
    dwAudio As Long
    dwTempo As Long
    dwPort As Long
    dwSlave As Long
    dwMaster As Long
    dwOffset As Long
End Type


'  MCI extensions for animation devices

'  flags for dwFlags parameter of MCI_OPEN command message
Public Const MCI_ANIM_OPEN_WS = &H10000
Public Const MCI_ANIM_OPEN_PARENT = &H20000
Public Const MCI_ANIM_OPEN_NOSTATIC = &H40000

'  flags for dwFlags parameter of MCI_PLAY command message
Public Const MCI_ANIM_PLAY_SPEED = &H10000
Public Const MCI_ANIM_PLAY_REVERSE = &H20000
Public Const MCI_ANIM_PLAY_FAST = &H40000
Public Const MCI_ANIM_PLAY_SLOW = &H80000
Public Const MCI_ANIM_PLAY_SCAN = &H100000

'  flags for dwFlags parameter of MCI_STEP command message
Public Const MCI_ANIM_STEP_REVERSE = &H10000
Public Const MCI_ANIM_STEP_FRAMES = &H20000

'  flags for dwItem field of MCI_STATUS_PARMS parameter block
Public Const MCI_ANIM_STATUS_SPEED = &H4001&
Public Const MCI_ANIM_STATUS_FORWARD = &H4002&
Public Const MCI_ANIM_STATUS_HWND = &H4003&
Public Const MCI_ANIM_STATUS_HPAL = &H4004&
Public Const MCI_ANIM_STATUS_STRETCH = &H4005&

'  flags for the dwFlags parameter of MCI_INFO command message
Public Const MCI_ANIM_INFO_TEXT = &H10000

'  flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block
Public Const MCI_ANIM_GETDEVCAPS_CAN_REVERSE = &H4001&
Public Const MCI_ANIM_GETDEVCAPS_FAST_RATE = &H4002&
Public Const MCI_ANIM_GETDEVCAPS_SLOW_RATE = &H4003&
Public Const MCI_ANIM_GETDEVCAPS_NORMAL_RATE = &H4004&
Public Const MCI_ANIM_GETDEVCAPS_PALETTES = &H4006&
Public Const MCI_ANIM_GETDEVCAPS_CAN_STRETCH = &H4007&
Public Const MCI_ANIM_GETDEVCAPS_MAX_WINDOWS = &H4008&

'  flags for the MCI_REALIZE command message
Public Const MCI_ANIM_REALIZE_NORM = &H10000
Public Const MCI_ANIM_REALIZE_BKGD = &H20000

'  flags for dwFlags parameter of MCI_WINDOW command message
Public Const MCI_ANIM_WINDOW_HWND = &H10000
Public Const MCI_ANIM_WINDOW_STATE = &H40000
Public Const MCI_ANIM_WINDOW_TEXT = &H80000
Public Const MCI_ANIM_WINDOW_ENABLE_STRETCH = &H100000
Public Const MCI_ANIM_WINDOW_DISABLE_STRETCH = &H200000

'  flags for hWnd field of MCI_ANIM_WINDOW_PARMS parameter block
Public Const MCI_ANIM_WINDOW_DEFAULT = &H0&

'  flags for dwFlags parameter of MCI_PUT command message
Public Const MCI_ANIM_RECT = &H10000
Public Const MCI_ANIM_PUT_SOURCE = &H20000
Public Const MCI_ANIM_PUT_DESTINATION = &H40000

'  flags for dwFlags parameter of MCI_WHERE command message
Public Const MCI_ANIM_WHERE_SOURCE = &H20000
Public Const MCI_ANIM_WHERE_DESTINATION = &H40000

'  flags for dwFlags parameter of MCI_UPDATE command message
Public Const MCI_ANIM_UPDATE_HDC = &H20000

'  parameter block for MCI_OPEN command message
Type MCI_ANIM_OPEN_PARMS
    dwCallback As Long
    wDeviceID As Integer
    wReserved0 As Integer
    lpstrDeviceType As String
    lpstrElementName As String
    lpstrAlias As String
    dwStyle As Long
    hWndParent As Integer
    wReserved1 As Integer
End Type

'  parameter block for MCI_PLAY command message
Type MCI_ANIM_PLAY_PARMS
    dwCallback As Long
    dwFrom As Long
    dwTo As Long
    dwSpeed As Long
End Type

'  parameter block for MCI_STEP command message
Type MCI_ANIM_STEP_PARMS
    dwCallback As Long
    dwFrames As Long
End Type

'  parameter block for MCI_WINDOW command message
Type MCI_ANIM_WINDOW_PARMS
    dwCallback As Long
    hWnd As Integer
    wReserved1 As Integer
    nCmdShow As Integer
    wReserved2 As Integer
    lpstrText As String
End Type

'  parameter block for MCI_PUT, MCI_UPDATE, MCI_WHERE command messages
Type MCI_ANIM_RECT_PARMS
    dwCallback As Long
    rc As RECT
End Type

'  parameter block for MCI_UPDATE PARMS
Type MCI_ANIM_UPDATE_PARMS
    dwCallback As Long
    rc As RECT
    hDC As Integer
End Type


'  MCI extensions for video overlay devices

'  flags for dwFlags parameter of MCI_OPEN command message
Public Const MCI_OVLY_OPEN_WS = &H10000
Public Const MCI_OVLY_OPEN_PARENT = &H20000

'  flags for dwFlags parameter of MCI_STATUS command message
Public Const MCI_OVLY_STATUS_HWND = &H4001&
Public Const MCI_OVLY_STATUS_STRETCH = &H4002&

'  flags for dwFlags parameter of MCI_INFO command message
Public Const MCI_OVLY_INFO_TEXT = &H10000

'  flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block
Public Const MCI_OVLY_GETDEVCAPS_CAN_STRETCH = &H4001&
Public Const MCI_OVLY_GETDEVCAPS_CAN_FREEZE = &H4002&
Public Const MCI_OVLY_GETDEVCAPS_MAX_WINDOWS = &H4003&

'  flags for dwFlags parameter of MCI_WINDOW command message
Public Const MCI_OVLY_WINDOW_HWND = &H10000
Public Const MCI_OVLY_WINDOW_STATE = &H40000
Public Const MCI_OVLY_WINDOW_TEXT = &H80000
Public Const MCI_OVLY_WINDOW_ENABLE_STRETCH = &H100000
Public Const MCI_OVLY_WINDOW_DISABLE_STRETCH = &H200000

'  flags for hWnd parameter of MCI_OVLY_WINDOW_PARMS parameter block
Public Const MCI_OVLY_WINDOW_DEFAULT = &H0&

'  flags for dwFlags parameter of MCI_PUT command message
Public Const MCI_OVLY_RECT = &H10000
Public Const MCI_OVLY_PUT_SOURCE = &H20000
Public Const MCI_OVLY_PUT_DESTINATION = &H40000
Public Const MCI_OVLY_PUT_FRAME = &H80000
Public Const MCI_OVLY_PUT_VIDEO = &H100000

'  flags for dwFlags parameter of MCI_WHERE command message
Public Const MCI_OVLY_WHERE_SOURCE = &H20000
Public Const MCI_OVLY_WHERE_DESTINATION = &H40000
Public Const MCI_OVLY_WHERE_FRAME = &H80000
Public Const MCI_OVLY_WHERE_VIDEO = &H100000

'  parameter block for MCI_OPEN command message
Type MCI_OVLY_OPEN_PARMS
    dwCallback As Long
    wDeviceID As Integer
    wReserved0 As Integer
    lpstrDeviceType As String
    lpstrElementName As String
    lpstrAlias As String
    dwStyle As Long
    hWndParent As Integer
    wReserved1 As Integer
End Type

'  parameter block for MCI_WINDOW command message
Type MCI_OVLY_WINDOW_PARMS
    dwCallback As Long
    hWnd As Integer
    wReserved1 As Integer
    nCmdShow As Integer
    wReserved2 As Integer
    lpstrText As String
End Type

'  parameter block for MCI_PUT, MCI_UPDATE, and MCI_WHERE command messages
Type MCI_OVLY_RECT_PARMS
    dwCallback As Long
    rc As RECT
End Type

'  parameter block for MCI_SAVE command message
Type MCI_OVLY_SAVE_PARMS
    dwCallback As Long
    lpfilename As String
    rc As RECT
End Type

'  parameter block for MCI_LOAD command message
Type MCI_OVLY_LOAD_PARMS
    dwCallback As Long
    lpfilename As String
    rc As RECT
End Type


' ***************************************************************************

'                         DISPLAY Driver extensions

' ****************************************************************************/

Public Const CAPS1 = 94                     '  other caps
Public Const C1_TRANSPARENT = &H1           '  new raster cap
Public Const NEWTRANSPARENT = 3             '  use with SetBkMode()
Public Const QUERYROPSUPPORT = 40           '  use to determine ROP support

' ***************************************************************************

'                         DIB Driver extensions

' ****************************************************************************/

Public Const SELECTDIB = 41                             '  DIB.DRV select dib escape


' ***************************************************************************

'                         ScreenSaver support

'     The current application will receive a syscommand of SC_SCREENSAVE just
'     before the screen saver is invoked.  If the app wishes to prevent a
'     screen save, return non-zero value, otherwise call DefWindowProc().

' ****************************************************************************/


Public Const SC_SCREENSAVE = &HF140

