Mcisendstring Is used to play multimedia files API Command, which can be played MPEG, Avi, WAV, MP3, And so on.
This function has four parameters:
The first parameter is the command string to be sent. The string structure is :[ Command ] [ Device alias ] [ Command Parameters ].
Second parameter: the buffer zone of the returned information , Is a string variable with a specified size. .
Third parameter: buffer size , Is the length of the character variable .
Fourth parameter: callback method, usually set to zero
Return Value: if the function is successfully executed, zero is returned. Otherwise, an error is returned.Code
For details, refer to (http://www.cnblogs.com/zrx401558287/archive/2008/11/28/1343160.html)
First, introduce this API function in the code.
Code
[Dllimport ( " Winmm. dll " , Entrypoint = " Mcisendstring " , Charset = Charset. Auto)]
Public Static Extern Int Mcisendstring (
String Lpstrcommand,
String Lpstrreturnstring,
Int Ureturnlength,
Int Hwndcallback
);
Start the recording.
Code
Mcisendstring ( " Close movie " , "" , 0 , 0 );
Mcisendstring ( " Open New Type waveaudio alias movie " , "" , 0 , 0 );
Mcisendstring ( " Record movie " , "" , 0 , 0 );
Close the recording and save it to a file, such as c: \ 1.wav.
Code
Mcisendstring ( " Stop movie " , "" , 0 , 0 );
Mcisendstring ( " Save Movie J: \ 1.wav " , "" , 0 , 0 );
Mcisendstring ( " Close movie " , "" , 0 , 0 );
OK, very simple