Public Function GetMsgProc(ByVal uCode As Long _
, ByVal wParam As Long _
, ByRef lParam As MSG) As Long
If uCode = 0 Then
If wParam = PM_REMOVE Then
Dim tHeader As WAVEHDR
Dim lIndex As Long
Select Case lParam.message
Case MM_WOM_DONE
memcpy tHeader, ByVal lParam, Len(tHeader)
' // Search for free buffer
For lIndex = 0 To UBound(m_tBuffer)
If m_tBuffer(lIndex).tHeader.lpData = tHeader.lpData Then Exit For
Next
NeedNewData m_tBuffer(lIndex).bData()
waveOutWrite m_hWaveOut, m_tBuffer(lIndex).tHeader, Len(m_tBuffer(lIndex).tHeader)
Case Else
GetMsgProc = CallNextHookEx(hHook, uCode, wParam, lParam)
End Select
End If
End If
End Sub
and use UnhookWindowsHookEx in UninitializeSubclassing as follows:
Code:
Private Sub UninitializeSubclassing()
If bHooked Then
UnhookWindowsHookEx hHook
bHooked = False
End If
End Sub
so that I can hook to default message loop and use the following code in InitPlayback
I am sending the project code using waveOutOpen(m_hWaveOut, WAVE_MAPPER, tFormat, App.ThreadID, 0, CALLBACK_THREAD) as attachment.
When we compile and run the code I am getting the Play button disabled.Please clarify how to make the Play button enabled and make the code work properly.