<p>Can we programatically login to Yahoo services with our ID, send instant message, use webcam service and so on directly from our program?</p>

Yahoo Messenger has a
plug-in SDK
. It is hard to know if this meets your needs, since you are not very clear.
If you are looking to access Yahoo messenger services through Java for instance, you could try an
API
.