If you believe the pundits, you'd think that Microsoft was one step from the grave, a company teetering on the edge of financial ruin and no longer technologically relevant. After all, Microsoft's most recent financial results show that it has had the worst year in its history. For the first time, revenue from Windows dropped from the previous year -- $3.1 billion for the quarter that ended on June 30, compared to $4.36 billion for the same quarter a year earlier.

The sagging economy is only partly to blame. Much of the problems are of Microsoft's own making. From a business point of view, for example, Vista was an unmitigated disaster. Enterprises have avoided it like the plague. A study by Forrester Research found that 86% of corporate PCs still run XP.

Then, of course, there's Google, which owns the Internet search market, even though Microsoft has spent untold amounts of money trying to catch up. And Google has targeted the heart of the Microsoft empire by announcing that it is developing an operating system called Chrome and by pushing Google Apps as a lower-cost or free alternative to Microsoft Office.

Sounds grim, doesn't it? The truth is, though, in the midst of all the bad news, it looks as if Microsoft has finally got its mojo back. There's evidence that the company may finally be recovering from its worst year ever.

For a start, there's the impending release of Windows 7. The new operating system is fast and responsive and has fixed many of Vista's problems. It won't be publicly available until late October, yet for a while it topped Amazon's software best-seller list. It still hovers around 25th to 30th -- impressive for software that won't be available for months.

Microsoft also revamped its search engine, which it now calls Bing. Bing is an impressive piece of work, and for the first time Microsoft has a search site that can rival Google's in terms of technology. And the company's recently announced deal with Yahoo will help Microsoft gain more revenue from the Web.

Microsoft also released a very solid beta of Microsoft Office 2010, and Office will finally be available as a Web-based application. This will likely be enough to fend off Google Apps.

Finally, Microsoft put Apple on the defensive with a set of aggressive ads called Laptop Hunters that play up the price differential between Apple and Windows-based laptops. So what happened to Microsoft? Why is the company hitting its stride again?

The primary reason is cultural. Microsoft was always at its best when it believed it was an underdog. Bill Gates was excellent at creating that striver culture, but in his later years, one had the sense that his attention had wandered. And once he left, the company culture was adrift.

Microsoft's culture has changed because for the first time in a long time, the company is, in fact, an underdog. Google has been on top of Internet search and services, Apple got all the buzz for its new products, and Vista was widely reviled.

Microsoft finally recognized that it couldn't just sit on a pot of cash and giant market share. If it didn't start releasing solid products and rethink its Internet strategy, Google could eventually own even the desktop. In short, the company got hungry again. That's not to say that Microsoft is perfect. It needs to more aggressively Web-enable its applications, and it should slim down Windows and possibly release the operating system as a series of constantly upgraded mix-and-match components. It needs to develop breakthrough products in the way that Apple has done.

It's hard to know whether that's possible in the long run. But for now, at least, Microsoft has its mojo back.

Preston Gralla is a contributing editor for Computerworld.com and the author of more than 35 books, including How the Internet Works (Que, 2006).