Sayyiduna Awf bin Malik (may Allah be pleased with him) narrates from the Messenger of Allah (peace and blessings be upon him) that he (peace and blessings be upon him) said: "Dreams are of three kinds: one is terrifying images from Satan to grieve the son of Adam; another is what a man has been thinking about while awake and then sees in his sleep; and the third is one part of the forty-six parts of prophethood." I asked him: Did you hear this yourself from the Messenger of Allah (peace and blessings be upon him)? He said: Yes, I heard it myself from the Messenger of Allah (peace and blessings be upon him).
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 15209