Can I synchronize a thread with the monitor refresh ? Probably I could, because DirectX can, just I don't know how.

More specifically, how can I predict the time a monitor refresh will occur ?

(Although I'm a Visual C++ programmer I can take a little assembly language if necessary.)