Hello,
When you install NI-IMAQ and have selected support for C a couple of examples are installed that may be helpful.  They are located in the following directory : C:\Program Files\National Instruments\NI-IMAQ\Sample\MSVC\Signal IO. You will find a triggered Snap.vi and also a Stop Trigger.vi.  These examples should give you a good start.  Hope this helps.  Have a good one.
-DC-