MSRS can be controlled by other programs. For example other software can start or stop recording. This is useful for creating automation systems. For example, you could write a small program to activate MSRS over the network or integrate it with other court software.

This page sets out the information about how to do this using the MSRS API. This information is intended for professional programmers only. The examples below are in C++ but you should have no difficulty using other languages (eg. Visual Basic etc.).

Running MSRS

Before any of the function calls below can be called, MSRS must be running. If you need to launch it from your program use WinExec, ShellExecute or CreateProcess to open:

"C:\Program Files\NCH Swift Sound\MSRS\msrs.exe"

You will need to wait for it to create its window before FindWindow will succeed (read on). For this we recommend you add a 10 second timer.

Finding the MSRS Main Window

Commands are Sent to the MSRS Main Window. To find the window use code like this:

HWND MSRSAPIFindWindow()

{

return FindWindowEx(NULL, NULL, NULL, TEXT("MSRS Recording System"));

}

Starting the Recorder

To start the recorder on a specified channel send the MCI_RECORD message to the MSRS Main Window like this:

void MSRSAPIStartRecorder()

{

HWND hWndMSRS = MSRSAPIFindWindow();

if (hWndMSRS == NULL) {

// MSRS not running run it or spit out error

return;

}

SendMessage(hWndMSRS, MCI_RECORD, 0, 0);

}

Stopping the Recorder

To stop the recorder use the MCI_STOP message as follows:

void MSRSAPIStopRecorder()

{

HWND hWndMSRS = MSRSAPIFindWindow();

if (hWndMSRS == NULL) {

// MSRS not running

return;

}

SendMessage(hWndMSRS, MCI_STOP, 0, 0);

}

MCI_RECORD and MCI_STOP are defined in the Windows API documentation but if your compiler does not have them, these are the values:

#define MCI_RECORD 0x080F

#define MCI_STOP 0x0808

If you have problems writing your application, please write to us at http://www.nch.com.au/msrs/support.html for support.

If you wish to distribute the MSRS packaged with your software please contact us at http://www.nch.com.au/msrs/support.html. We have very easy and affordable OEM license terms for distributing MSRS.