“[T]he hamentashen are also of German origin. Originally they were called mohn-tashen, mohn meaning poppy seed and tashen meaning pockets and also signified dough that is filled with other food stuffs. The people therefore related the cake to the book of Esther and changed the mahn to Haman [due to its similarity]. In time the interpretation arose that the three cornered cakes are eaten because Haman wore a three cornered hat when he became prime minister to Ahasuerus. The three corners were also interpreted as a symbolic sign of the three patriarchs whose merit aided the Jews against Haman.”
Hayyim Schauss, The Jewish Festivals page 270, as quoted in The Origins of Hamentashen in Jewish Literature:
A Historical-Culinary Survey, By Eliezer Brodt on SeforimBlog.
Of course, if you ask many haredim, they'll tell you Mordechai and Esther ate them, as well.