Hakim al Ummah Mawlana Ashraf Ali Thanawi (Allah have mercy on him) said,
‘Khatir is the thought that descends on the heart (qalb).
It has four categories. First is from Allah, the next from angel, another from the lower self (nafs) and the fourth from the Satan.
The first is known as khatir-e-Haq, the second as ilham, the third as hawajas and the fourth as wasawes.
Following is the way to distinguish them.
If the incoming thought is of virtuous nature and one can act against it, then it is a ilham. If one can not act against it then it is a katir-e-Haq.
If the incoming thought is of immoral nature and incites the blame worthy morals of the lower self, like lust, anger, etc. then it is from hawajes. If it lead to desires of sinful activities (in general) then it is from wasawes.
Shariat wa tariqat, page 355