Draw lines and add to shape file in delphi

Hello to all
I’m a Delphi programmer
I asked the esteemed rulers to show me how I can draw the lines I drew with the Measure tool in one shape file?
And how to calculate the azimuth of a line?
Thanks to the Mapwindow team.