It's easy to be critical, but you need to understand history to see how the world got to be as it is.
Warnings:
1) Long post (bad, yeah) - if you hate history, skip this post!
2) Defence of Microsoft follows (evil, eh!) - are there really two sides to a story?
3) Random thoughts, so excuse incoherence/lack of brevity (I'm entirely to blame).
The majority of the effort in the NT-based releases of Windows (Win NT, 2K, XP, Vista, W7) revolves around trying to maximise support for legacy apps and hardware, ie trying to preserve compatibility with older apps and devices. Last I looked Microsoft includes over 300 thunks and fiddles in Windows as workarounds for legacy and badly coded non-MS apps written in often flagrant disregard of Window Programming Guidelines.
One of the major reasons why Windows emerged as the OS leader is precisely because MS understood the importance of taking the installed base with you. If you know anything about the evolution of PCs, you will appreciate how impossibly difficult it was to bring the past into the future through major platform/architecture shifts (such as from real mode to protect mode, from segmented memory to large direct addressing, for example). Indeed, every major platform shift has seen the death of the previous giants, and the emergence of new ones -with one exception so far: Microsoft. Why?
Back in the mid-80s, MS realised along with everyone else that desktop operating systems needed a radical redesign, from the ground up, because the architectures were changing and the old Extended and Expanded Memory Specification fiddles for getting past Real Mode and 8-bit addressing just couldn't cut it.
By 1985 MS had entered into a JDA (joint development agreement) with IBM to develop an entirely new OS from the ground up - the first truly new operating system since the mid-60s (almost all commercially viable non-IBM OSs were derivatives or spin-offs from UNIX - and remember that IBM's proprietary OS/360 / MVS / VM and S/36 & S/38 systems ran 90% of the installed MIPS in the Free World). MS hired the best OS brains in the industry (remember Gordin Letwin? Later, Dave Cutler from DEC, and many other leading lights from outside the company) and by 1988 came up with the so called Platform For the Future, also called Operating System/2 or OS/2 (first released without a GUI in late 1987 as OS/2 1.0 for the 80286).
It was a truly groundbreaking development. But OS/2 had one snag - it required entirely new apps, with a massive increase in development complexity, and there few tools, especially in the then newly-emerging OO design paradigm. And while MS had MS-DOS (licensed as PC-DOS to IBM ... and DOS itself was UNIX-inspired, a "quick 'n dirty OS") and the fledgling Windows, others ruled the roost with apps (notably Lotus Development, Wordperfect Corp, Corel, Ashton-Tate, and others).
With the unexpected success -- and I might add a success undesired by MS because of its massive corporate-wide commitment to OS/2 as the future OS -- Microsoft had to rethink everything. Could it afford to bet the entire ship on the as-yet unreleased and unproven OS/2, with exactly zero applications? However elegant and future-capable, OS/2 introduced all sorts of complexities unknown in the PCs, such as multiple threads, and hope the world would move to 32-bit (at that time 99% of PCs were 8086 or 80286-based, with the first Intel 32-bit CPU only released in 1986, and hugely expensive), and above all zero apps? When Windows 3.0 (the last scheduled release of Windows, which had been in the works since before the JDA with IBM) took off unexpectedly - largely because it offered an unprecedently easy way of running multiple Real Mode apps with either Extended or Expanded Memory support -- Microsoft took a huge gamble (get this): it listened to what its customers and users said.
(As an aside, Apple was so rattled by OS/2 and IBM's companion PS/2 that it sued both IBM and Microsoft to try to get it stopped. Apple falsely claimed it invented the WIMP (windows, icons, menus, pointing-device) GUI, and tried to patent a whole slew of technologies it didn't invent. Apple, through its closed always-proprietary systems and endless lawsuits against anyone and everyone, quickly alienated millions of users, and its marketshare quickly dwindled to irrelevance.)
Now you might not like Windows, but what Microsoft has pulled off with Windows is nothing short of astonishing. There were many inside and even more outside the company who believed it just couldn't be done, given the almost irreconcilable demands of legacy app compatibility, system integrity and performance. The choice in the end was between surviving as a systems vendor (which absolutely demanded compatibility with the then dominant non-MS apps, whose vendors had said switching to OS/2 was too much work), and sticking doggedly to something MS knew was better from a systems architecture viewpoint. In other words: choose betwen commercial survival or technological purity. Fact: the industry is littered with the carcasses of technological purists. Truism: Almost every successful technology (much like great human relationships) is the result of seemingly impossible compromises.
The internal debates in MS were ultra-intense, and both sides were argued by the brightest heads in the industry. In the end MS chose to live another day, and work super-hard to evolve Windows into something that was viable. It knew the pace of this evolution would depend on a whole host of industry factors, including hardware developments.
The Big News for years was the "great divorce" between IBM and Microsoft. The OS/2 JDA was terminated. IBM stuck with OS/2, mainly because it wanted to leverage OS/2 to protect its PS/2 hardware, and over the next few years its marketshare in PCs and OS/2 dwindled from 80% to single digits ... eventually the once dominant IBM exited the PC business and sold what was left to Lenovo. OS/2 evolved into Warp, but that wasn't enough to stop the death-spiral as lack of apps meant lack of sales, which meant even less developers and less apps, which meant diminishing marketshare, all the way down to oblivion.
By listening to its customers - users like you and me - Microsoft reversed course and (do you know how hard it is to give up on your own great inventions?)
And so a five-step multi-year strategy was developed:
Step One: Develop DOS+Windows as far as the architecture allows, merging DOS into Windows, and establish Windows (and not DOS) as the OS platform. Mission accomplished with Win95 (revved in Win98 and Win/ME).
Step Two: In parallel, and leveraging the OS/2 work done to date, switch the Apps API from SAA (systems Application Architecture) Presentation Manager to Windows (and call it Windows NT for "New Technology"), which requires defining and extending the new Win32 API (from Step One). Mission accomplished with Windows NT (Win 3.1 GUI) and Windows 2000 (Win95 GUI).
Step 3: Merge Steps One and Two into a unified Windows operating system built on the NT kernel. Mission Accomplished in Windows XP.
Step Four: As hardware capabilities permit, abstract the Windows API set, device drive rmodel, and other critical elements, and evolve and optimise (Unified) Windows towards an Entirely New Operating System (Step 5)
Step 5: When technical, hardware and market conditions allow, seamlessly introduce a fully componentised OS with completely managed tools and libraries (this has never been done before, by anyone). Ensure the development tools are fully in place, and that provision is made for legacy compatibility in a manner that doesn't jeopardise system integrity or security. If you're interested in this part, do a search on Singularity and Midori.
I've taken up a lot of your time trying to give you some background on why Windows looks like it does today. I'm not defending mistakes or less-than-optimal code, of which there are many examples, as any Microsoftie will readily admit (everyione ash to work in a time and financial budget). The ignorant will rant on about MS designing a poor OS, and MS developers being a useless lot. These people don't know what they're talking about.
Arguably, you will be hard put to find anywhere on earth a smarter or more knowedgable or more capable group of systems experts and supersmart developers than at Microsoft. MS looks anywhere and everywhere for the smartest systems people - even deep inside Open Source, which it supports more than most people know (every Apache server runs with some code developed and supplied by MS, for example). MS understands exactly what Windows' weakensses are (heck, it knew that back in 1985, as billg said ad nauseam back in those times). But unlike many who shout religious-tech slogans from the sidelines, MS also understands that all the best plans in the world amount to nothing if you don't have the resources to implement, and to obtain and utilise those resources you must build and sustain a viable long-term business. Apart from requiring brains (which MS has in abundance, as proved by the almost-impossible evolution of Windows to where it is today), you need lots of money ... getting to Step Five non-disruptively would require about $10-billion (it was estimated in 1997, when I retired from Microsoft) , mainly to pay hire and retain the smartest people in the industry. That figure has probably doubled. Though I haven't been involved in this for many years, I remain intensely interested and stay in touch with those who are. And despite all sorts of curved balls, like people putting out malware with the aim of destroying PCs and data, and losers getting an ear with governments when (hand-on-heart I can say) Microsoft acts aggressively but always ethically, the strategy is being steadly and inexorably implemented.
Just my $0.03 worth.