Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to catch the MM_WOM_CLOSE message

Status
Not open for further replies.

Flagada

Programmer
Dec 22, 2005
8
NL
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
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top