home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form1
- Caption = "MCITest"
- ClientHeight = 5745
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 8205
- LinkTopic = "Form1"
- ScaleHeight = 5745
- ScaleWidth = 8205
- StartUpPosition = 3 'Windows Default
- Begin VB.TextBox History
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 1890
- Left = 210
- MultiLine = -1 'True
- TabIndex = 8
- Top = 3585
- Width = 7755
- End
- Begin VB.CommandButton Command1
- Caption = "Execute Command"
- Default = -1 'True
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 405
- Left = 5625
- TabIndex = 2
- Top = 855
- Width = 2355
- End
- Begin VB.TextBox MCIcommand
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 855
- Left = 240
- TabIndex = 0
- Top = 375
- Width = 5250
- End
- Begin VB.Label MCIerror
- BorderStyle = 1 'Fixed Single
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 315
- Left = 1935
- TabIndex = 10
- Top = 1905
- Width = 915
- End
- Begin VB.Label Label4
- Caption = "Error Code "
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 300
- Left = 210
- TabIndex = 9
- Top = 1905
- Width = 1230
- End
- Begin VB.Label Label6
- Caption = "Command History"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Left = 210
- TabIndex = 7
- Top = 3225
- Width = 1950
- End
- Begin VB.Label MCIstr
- BorderStyle = 1 'Fixed Single
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 630
- Left = 1920
- TabIndex = 6
- Top = 2385
- Width = 6030
- End
- Begin VB.Label MCIcode
- BorderStyle = 1 'Fixed Single
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 315
- Left = 1935
- TabIndex = 5
- Top = 1440
- Width = 6015
- End
- Begin VB.Label Label3
- Caption = "Return String"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Left = 180
- TabIndex = 4
- Top = 2370
- Width = 1380
- End
- Begin VB.Label Label2
- Caption = "Return Code"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Left = 210
- TabIndex = 3
- Top = 1440
- Width = 1185
- End
- Begin VB.Label Label1
- Caption = "Enter MCI Command here"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Left = 270
- TabIndex = 1
- Top = 75
- Width = 2760
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Declare Function mciSendStringA Lib "WinMM" _
- (ByVal MCIcommand As String, ByVal returnStr As String, _
- ByVal returnLength As Integer, ByVal callBack As Integer) As Long
- Private Declare Function mciGetErrorStringA Lib "WinMM" _
- (ByVal error As Long, ByVal buffer As String, _
- ByVal length As Integer) As Integer
- Private Sub Command1_Click()
- Dim errorCode As Long
- Dim returnStr As String * 255
- Dim returnCode As Integer
- Dim errorStr As String * 255
- errorCode = mciSendStringA(MCIcommand.Text, _
- returnStr, 255, 0)
- MCIerror.Caption = errorCode
- returnCode = mciGetErrorStringA(errorCode, errorStr, 255)
- MCIcode.Caption = returnStr
- MCIstr.Caption = errorStr
- If errorCode = 0 Then History.Text = History.Text & MCIcommand.Text & Chr$(13) & Chr$(10)
- End Sub
- Private Sub Form_Load()
- ChDir App.Path
- End Sub
-