Is there some sort of hardware signal that would accompany the vertical sync pulse? If you can get a hardware signal, synchronizing things will be much easier. I've never tried anything like this, but I can imagine several problems trying to do it through software. For one, I would bet that the type of functionality you want would be controlled by the graphics and video drivers, which means that you could not get it from a Windows API. Even if you could create a windows event for it, by the time you captured the event in your control software, you will have already lost several microseconds.