Despite the major ongoing shifts in the PC industry, Microsoft (MSFT -0.11%) has been a top performing tech stock over the last 12 months. Since last May, Microsoft stock has rallied more than 20%, outperforming the broader S&P 500.

Could Microsoft be headed higher? It's impossible to say for certain, but there are reasons to be optimistic about its business. Below are three scenarios that, if they came to pass, would likely benefit Microsoft shareholders.

Its commercial cloud business could continue its rapid growth
The recent rally in Microsoft stock has come despite a notable decline in Windows revenue. Last quarter, Windows OEM revenue contracted 22% on an annual basis. The decline was particularly notable among consumer PCs -- there, Windows revenue fell 26%.

Why have investors bid up Microsoft shares in the face of this decline? While Microsoft's past may have centered around Windows and Office, its future seems tied to the cloud.

And Microsoft's cloud business is booming. Last quarter, commercial cloud revenue rose 106% year over year. The business is now on pace for an annual run rate of $6.3 billion -- up from $5.5 billion in the prior quarter.

Demand for Microsoft's cloud products -- primarily Office 365, Azure, and Dynamics CRM -- has been strong, mostly among enterprise customers, but also with consumers: Microsoft now has 12.4 million consumers subscribing to Office 365.

If this cloud business continues to grow, Microsoft shares could continue heading higher. 

Windows 10 could be a success
Windows 8 was a failure. Despite making its way onto several hundred million PCs, it failed to do what it was designed for: keep Microsoft's Windows platform relevant in an increasingly mobile-centric world.

Reviewers panned Windows 8's dual user interfaces, its confusing mishmash of tiles, and the lack of the traditional Start menu. To this day, Windows 8's app store is a barren wasteland. Windows RT, the version designed exclusively for tablets, was dropped. Only a few devices managed to take advantage of its unique, hybrid features, and only years after its debut.

Windows 10, however, could be quite different, and if it succeeds where Windows 8 failed, it could serve as a powerful catalyst for Microsoft's stock. 

Windows 10 appears to be a more fully fleshed-out version of Windows 8, with a unified interface and support for a wide variety of different form factors. If that proves enticing to both developers and to users, the PC platform could be reinvigorated. Don't expect Windows revenue to experience much of a resurgence -- Microsoft is giving some versions of Windows 10 away for free -- but Microsoft's other businesses could benefit. Windows 10 is packed with features that emphasize Microsoft's other offerings, including the Xbox, Bing, and Cortana.

Perhaps most importantly, if Windows 10 is a hit, it would help alleviate the creeping fear that Microsoft's days in the operating system business are numbered.

Windows Mobile could emerges as a legitimate alternative
When it comes to traditional smartphones and tablets, Microsoft is basically a non-factor. It has seen sales of its Surface tablets surge in recent quarters, but those are largely laptop replacements rather than true mobile devices. Meanwhile, its share of the global smartphone market remains in the low single digits.

Still, Microsoft isn't giving up on Windows Mobile. Last month, at its Build developer conference, it unveiled a series of toolkits that would allow developers to port their existing Android and iOS apps over to Windows Mobile. It's a very aggressive move, one that could ultimately backfire by further marginalizing native Windows Mobile support, but it's a way to solve Microsoft's biggest mobile problem: Its lack of apps.

Reacting to the news, Box's CEO Aaron Levie tweeted that "For a while there was just Microsoft. Then it was Apple and Microsoft. Then it was Apple and Google. Now it's all 3. This will be fun."

If Microsoft can turn its mobile business around, it could catalyze a move higher in its stock. With its ownership of Nokia's former handset business, Microsoft is now the primary producer of Windows-powered smartphones. When that business is working, it can be very lucrative -- just ask Apple.