Попробуй вот так
Path.s="guitar_sample.mid" If OpenWindow(0, 100, 100, 100, 100, "Beispiel: MP3 Abspielen", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget) ButtonGadget(11,20,20,20,20,"") Buffer$=Space(128) Repeat EventID.l = WaitWindowEvent() If EventID = #PB_Event_CloseWindow ; If the user has pressed on the close button mciSendString_("CLOSE MIDI",0,0,0) Quit = 1 EndIf If EventID=#PB_Event_Gadget If EventGadget()=11 mciSendString_("CLOSE MIDI",0,0,0) mciSendString_("OPEN "+Path+" TYPE SEQUENCER ALIAS MIDI",@Buffer$,128,0) mciSendString_("PLAY MIDI",0,0,0) EndIf EndIf Until Quit = 1 EndIf