I played with Windows Phone 7 and 8 (not tried 10). They seemed (from a user point of view) to be better designed that most Android variants I've tried, and although I am a long term iPhone user, I like Android as well.
They also had Nokia, a company with excellent brand recognition that goes all the way back to the start of Mobile phones, and while it had lost it's way toward the end, it did build some excellent phones. They married that up with Windows Phone. I believe that had they marketed both Windows Phone and their own handsets effectively, they would have had the number one mobile OS. iOS or Android would have been relegated to 3rd place., If Microsoft had got Samsung fully on their side, it's likely that Android would be in 3rd place, and possibly even killed off.
Hell, when Blackberry died out, the corporates were crying out for a replacement that integrated with their existing infrastructure (which is likely to be Windows based) as well as BES. Microsoft had a ready made target audience.
Instead, they launched a half arsed attempt to market both phones and OS, and failed.