In Persian Seistan from 600 to 900 AD wind mill machines of a vertical shaft type were used grind grain and pump water. They could not change positions as the wind did but the wind generally blew in one direction. They were not as powerful as the post-mills because only some of the sails were catching the wind at a time. A wall was built around half of the structure shielding the wind from slowing the returning sails. They probably evolved from the water driven "Norse water wheels" engines.
We know Holland type Windmills (post-mills) were invented before 1180 because of the many documents including ones that show a tax imposed on them by Pope Celestine III (1191-1198). In the northern plains of Europe windmills quickly became popular. Over 120 were established in the 1200's around the city of Ypres (in Belgium). Their speed of rotation was controlled by furling the sails as required.
These post-mills were mounted on a large vertical post and the whole mill, tower, stone, steps and doors could be moved to take advantage of wind direction change. They were rotated by pushing a long tailpole that extended far out and near the ground. This would move the whole superstructure.
Before the Europeans harnessed wind for their power they had been using waterwheels and tidal mills. Wind power had the advantage of working in the winter where the freezing of water was not a hindrance. Great prominence was placed on owners of windmills as the powerful controlled and protected their mills and territory.
Sources: A Short History of Technology: From the Earliest Times to A.D. 1900 by Thomas Derry & Trevor Williams, The Medieval Machine by Jean Gimpel, Wikipedia, V. Ryan