http://www.robbayer.com/files//serial-win.pdf
go to this link for windows serial port programming