wengang
Apr 20th, 2000, 07:43 PM
Hey guys,
I copied this code from MS's website to play a midi in the background:
Public gObjDX As New DirectX7
Public gObjDMLoader As DirectMusicLoader
Public gObjDMPerformance As DirectMusicPerformance
Dim objSegState As DirectMusicSegmentState
Dim objSeg As DirectMusicSegment
Set gObjDMLoader = gObjDX.DirectMusicLoaderCreate
Set gObjDMPerformance = gObjDX.DirectMusicPerformanceCreate
Call gObjDMPerformance.Init(Nothing, hWnd)
Call gObjDMPerformance.SetPort(-1, 1)
strMIDI = CurDir & "\Directory\music.mid"
Set objSeg = gObjDMLoader.LoadSegment(strMIDI)
Call gObjDMPerformance.SetMasterAutoDownload(True)
Call objSeg.Download(gObjDMPerformance)
Call gObjDMPerformance.PlaySegment(objSeg, 0, 0)
'Set objSegState = gObjDMPerformance.PlaySegment(gObjPrimarySeg, 0, 0)
SO what is the command to stop the music? Does anybody know this one?
I copied this code from MS's website to play a midi in the background:
Public gObjDX As New DirectX7
Public gObjDMLoader As DirectMusicLoader
Public gObjDMPerformance As DirectMusicPerformance
Dim objSegState As DirectMusicSegmentState
Dim objSeg As DirectMusicSegment
Set gObjDMLoader = gObjDX.DirectMusicLoaderCreate
Set gObjDMPerformance = gObjDX.DirectMusicPerformanceCreate
Call gObjDMPerformance.Init(Nothing, hWnd)
Call gObjDMPerformance.SetPort(-1, 1)
strMIDI = CurDir & "\Directory\music.mid"
Set objSeg = gObjDMLoader.LoadSegment(strMIDI)
Call gObjDMPerformance.SetMasterAutoDownload(True)
Call objSeg.Download(gObjDMPerformance)
Call gObjDMPerformance.PlaySegment(objSeg, 0, 0)
'Set objSegState = gObjDMPerformance.PlaySegment(gObjPrimarySeg, 0, 0)
SO what is the command to stop the music? Does anybody know this one?