Private Sub Form_Load()
ChDrive App.Path' Set the drive. ChDir App.Path ' Set the directory. Timer1.Interval = 1000 End Sub Private Sub Label9_DragOver(Source As Control, X As Single, _ Y As Single, State As Integer) Timer1.Interval = 500 End Sub Private Sub mnuAbout_Click() Dim Msg, Style, Title Msg = "Any help is appreciated."' Define message. Style = vbOKOnly ' Define buttons. Title = "About Mod Player" ' Define title. Response = MsgBox(Msg, Style, Title, Help, Ctxt) If Response = vbYes Then' User chose Yes. MyString = "Yes"' Perform some action. Else' User chose No. MyString = "No" ' Perform some action. End If End Sub Private Sub mnuExit_Click() Close #1 exit_Left Me End Sub Private Sub mnuOpen_Click() 'Set CancelError is True CommonDialog1.CancelError = True On Error Goto ErrHandler 'Set flags CommonDialog1.Flags = cdlOFNHideReadOnly 'Set filters CommonDialog1.Filter = "All Files (*.*)|*.*|Mod Files" & _ "(*.Mod)|*.Mod|Xm Files (*.Xm)|*.Xm" 'Specify default filter CommonDialog1.FilterIndex = 2 'Display the Open dialog box CommonDialog1.ShowOpen 'Display name of selected file Close #1 Form1.Text1.Text = "" Form1.Text2.Text = "" Form1.Text3.Text = "" Form1.Text4.Text = "" Form1.Text5.Text = "" Form1.Text6.Text = "" Form1.Text7.Text = "" Open CommonDialog1.filename For Binary As #1 Dim Title As String Dim channels As String Dim sample_name1 As String Dim sample_name2 As String Dim sample_name3 As String Dim sample_name4 As String Dim sample_name5 As String Dim sample_name6 As String Dim sample_name7 As String Dim sample_name8 As String Dim sample_name9 As String Dim sample_name10 As String Dim sample_name11 As String Dim sample_name12 As String Dim sample_name13 As String Dim sample_name14 As String Dim sample_name15 As String Dim sample_name16 As String Dim sample_name17 As String Dim sample_name18 As String Dim sample_name19 As String Dim sample_name20 As String Dim sample_name21 As String Dim sample_name22 As String Dim sample_name23 As String Dim sample_name24 As String Dim sample_name25 As String Dim sample_name26 As String Dim sample_name27 As String Dim sample_name28 As String Dim sample_name29 As String Dim sample_name30 As String Dim sample_name31 As String Title = String(20, " ") Get #1, 1, Title Form1.Text1.Text = Title Form1.Text2.Text = "" channels = String(4, " ") Get #1, 1081, channels If channels = "M.K." Then Form1.Text2.Text = "4 Channel MOD" If channels = "6CHN" Then Form1.Text2.Text = "6 Channel MOD" If channels = "8CHN" Then Form1.Text2.Text = "8 Channel MOD" sample_name1 = String(22, " ") Get #1, 21, sample_name1 Form1.Text3.Text = sample_name1 'Dim sample_length1a As String 'Dim sample_length1b As String 'sample_length1a = String(1, " ") 'Get #1, 43, sample_length1a 'sample_length1b = String(1, " ") 'Get #1, 44, sample_length1b 'Dim real_sample_length1 As String 'real_sample_length1 = ((sample_length1a * 100h) + _ 'sample_length1b) * 2 'Form1.Text4 = sample_length1 'Dim fine_tune1 As String fine_tune1 = String(1, " ") Get #1, 45, fine_tune1 Form1.Text4 = fine_tune1 Dim volume1 As String volume1 = String(1, " ") Get #1, 46, volume1 Form1.Text6 = volume1 Dim loop_start1 As String loop_start1 = String(2, " ") Get #1, 48, loop_start1 Form1.Text7 = loop_start1 Dim loop_length1 As String loop_length1 = String(2, " ") Get #1, 50, loop_length1 Form1.Text8 = loop_length1 ErrHandler: 'User pressed the Cancel button Exit Sub End Sub Sub exit_Left(winform As Form) Do winform.Left = Trim(Str(Int(winform.Left) - 300)) DoEvents Loop Until winform.Left < -e'00 If winform.Left < -e'00 Then End End Sub Private Sub Timer1_Timer() If Label9.Visible = False Then Label9.Visible = True Else: Label9.Visible = False End If If Form1.Caption = "Mod Player ~ " Then Form1.Caption = "Mod Player ~ Under Development" Else: Form1.Caption = "Mod Player ~ " End If End Sub Inputs: Uses common dialog control to open a *.MOD file Returns: After opening a MOD file. It displays the Title, # of Channels, and 1st Instrument name. I have a version that shows allof the intruments but we must be simple first. Assumes: That you know what a MOD file is ( the music kind). Have at least 1 mod file in your possession. If not Get one from the inter net. That you have a form (form1) With the following: MENU= file(mnuFile), Open(mnuOpen), Exit(mnuExit) Then Help(mnuHelp), About(mnuAbout) A timer1 and commondialog1. texbox1 - textbox8 With labels (look at code to determin labels)Also, If it matters label9 is switched from visible false/true so after labelin all your text boxes put a label9 out theer or delete that part of the code. |