Microsoft Corp. (Nasdsaq: MSFT) Chief Executive Officer Steve Ballmer said 4 million Windows 8 upgrades were sold to consumers since the flagship operating system for personal computers went on sale last week.

SAP AG, Twitter Inc. and Dropbox Inc. are building applications for Windows 8, Ballmer said at a conference for developers at Microsoft’s headquarters in Redmond, Washington. He said application developers would benefit from their familiarity with older Windows versions and will be able to write for mobile phones and tablets.

Twitter said it is building a tool that would make it easier for computer users to communicate using the Twitter microblogging service.

“Windows 8 needs a great Twitter app,” according to a short blog by Twitter Mobile. “So we’re building it. Looking forward to sharing it with you in the months ahead.”

The message was confirmed by San Francisco-based Twitter.

The world’s largest software maker began selling Windows 8 on Oct. 26. The operating system has been completely redesigned to work with desktops, laptops and touch-screen tablets as Microsoft competes with Apple Inc. and Google Inc. for the loyalty of customers who are increasingly shunning PCs and flocking to mobile devices. Attracting developers to write apps for Windows will be crucial in capturing sales.

“Windows 8 needs a great Twitter app,” Twitter said in a short blog, which was confirmed by the company. “So we’re building it. Looking forward to sharing it with you in the months ahead.”

Downloadable applications have become central to the way customers use tablet computers, and one of Apple’s selling points is its leadership in apps. Google said yesterday it has matched the 700,000 apps that Apple offers on its online store.

Walt Disney Co., ESPN and Lego A/S are also developing applications for Windows 8, Microsoft said. The software maker also showed how developers could set up payment systems in their apps from either PayPal or Microsoft.