How did muhammad learn that Allah had chosen him as phrophet?

You'll find the answer in part II of this article.

http://encarta.msn.com/encyclopedia_761553918/Muhammad.html