SendMarkerDemo for Somatic Vision Alive README.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

=== SIMPLE SEND USING A SWITCH ===

You can use the SendMarkerBuild to add a marker without any programming. This is slightly less efficient than actually working with the source code, but may be easier.  

Launch the SendMarkerBuild/SendMarker.exe file with a switch: -addlabel "label text here" it will add a marker to Alive then quit.

You can run or edit the SendMarker - MARKER 1.bat as an example.

This may be useful for people without the programming skils or build environment to modify, compile, or integrate the actual SendMarkerCode into their project.


=== SEND DIRECTLY USING WINDOWS API WM_COPYDATA ===

The SendMarkerDemo application is provided with all source code and requires Microsoft(r) Visual C# 2005 or newer to be built.
The main features are implemented as parts of the Impl class. This class provides two public methods that implement 
key functionality. These are:
 - void SendMarker(string text) - invoke this to send a marker with text to Alive. Text may be empty;
 - void SimulateReturnKey() - invoke this to simulate a return key press. Alive being the foreground application and running in Graphing mode 
   can process return key presses no matter which control is focused at the moment, adding markers with whatever text is present in the text box. This method uses the SendKeys class 
   of the .NET framework as the easiest way to simulate different key presses.


NOTE: The SendMarker method uses one of the interoperability mechanisms supported by the .NET framework. This method 
uses the SendMessage WINAPI function in order to send a WM_COPYDATA message (for more information about WM_COPYDATA 
see http://msdn.microsoft.com/en-us/library/windows/desktop/ms649011%28v=vs.85%29.aspx). When being invoked this WINAPI 
function is passed four parameters as follows:

 - A handle to the server's window. This window's class name is "wxWindowClassNR". Its caption (text) is "Somatic Vision Socket Server". 
   These two strings are used to find the server's window (see the FindSVServerWindow private method of the Impl class);
 - The WM_COPYDATA message identifier (equal to 0x004A);
 - A zero value (not used);
 - A COPYDATASTRUCT structure instance where COPYDATASTRUCT.dwData is set to zero (zero is used as a message code to tell Alive what to do and namely
 - to add a marker), COPYDATASTRUCT.lpData contains the text of the marker to add (can be zero), COPYDATASTRUCT.cbData is set to the length of the text (can be zero if COPYDATASTRUCT.lpData is zero).


  

