Hello.
I want to catch the MM_WOM_CLOSE or MM_WOM_DONE message. These messages are sent after a WAV file has terminated to play. I found a page where they explain how to do it:
But it does not work. It is strange: when I replace MM_WOM_DONE by WM_MOVE in the code below, the message "WAV file ready" does appear on the Memo when the window is moved. But with MM_WOM_CLOSE or MM_WOM_DONE, nothing happens after a WAV file has been played (by the same application).
This is my code:
In unit1.h
In unit1.cpp
The WAV files are played using PlaySound, they are located in a resource file:
PlaySound("Sound1", HInstance, SND_ASYNC | SND_RESOURCE);
What am I doing wrong ?? Any help is highly appreciated.
I want to catch the MM_WOM_CLOSE or MM_WOM_DONE message. These messages are sent after a WAV file has terminated to play. I found a page where they explain how to do it:
But it does not work. It is strange: when I replace MM_WOM_DONE by WM_MOVE in the code below, the message "WAV file ready" does appear on the Memo when the window is moved. But with MM_WOM_CLOSE or MM_WOM_DONE, nothing happens after a WAV file has been played (by the same application).
This is my code:
In unit1.h
Code:
class TForm1 : public TForm
{
// things omitted
private:
void OnWaveDone(TMessage& msg);
public:
__fastcall TForm1(TComponent* Owner);
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(
MM_WOM_DONE, TMessage, OnWaveDone)
END_MESSAGE_MAP(TForm)
};
In unit1.cpp
Code:
void TForm1::OnWaveDone(TMessage& msg)
{
Memo1->Lines->Add("WAV file ready");
}
The WAV files are played using PlaySound, they are located in a resource file:
PlaySound("Sound1", HInstance, SND_ASYNC | SND_RESOURCE);
What am I doing wrong ?? Any help is highly appreciated.