The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Children's reactions to macadamia nuts dipped in chocolate
Sep 27, 2010
Post comments count 0
Post likes count 0

Children's reactions to macadamia nuts dipped in chocolate

Raymond Chen
Raymond Chen

Some time ago, we had some people over our house for dinner, and we had a selection of desserts including chocolate-covered macadamia nuts. The children in attendance finished their dinner before the adults (because the adults were busy doing boring things like talking) and were excused to go play. It so happens that the play room is right next to the kitchen, and in the kitchen was the dessert table, including a bowl of chocolate-covered macadamia nuts, which the children managed to consume in their entirety before the adults finally finished talking and went to get dessert. The second half of the story didn'...

Why not just require each application to declare what version of Windows it is compatible with?
Sep 27, 2010
Post comments count 0
Post likes count 0

Why not just require each application to declare what version of Windows it is compatible with?

Raymond Chen
Raymond Chen

Via the Suggestion Box, Arno Shoedl asked, "could not a lot of compatibility problems be solved by simply declaring (via manifest?) the earliest and latest version of Windows a program has been tested to run on?" Actually, programs already declare that, sort of. Each module has a subsystem field in the header that specifies the earliest version of Windows the program will run on. There isn't a corresponding way to declare the maximum version of Windows you want to run on, however, so the manifesty thing could be done there. (There is a new manifesty way of saying what version of Windows you would like to see.) ...

Does anybody actually like Brazil nuts?
Sep 24, 2010
Post comments count 0
Post likes count 0

Does anybody actually like Brazil nuts?

Raymond Chen
Raymond Chen

Brazil nuts are perhaps best known for floating to the top of a jar of mixed nuts. According to Wikipedia,¹ the reason for the phenomenon is not well understood. At least in my house, the reason for the phenomenon is quite clear: Brazil nuts float to the top because nobody in my house likes Brazil nuts. When you reach in and grab a handful of nuts, you toss the Brazil nuts back into the jar, which is why they end up on top. A few months ago, I asked "Does anybody actually like Brazil nuts?" A lot of people agreed with my opinion of them, but there was a notable dissenter: Larry Osterman. There is now a s...

How reliable is the BatteryLifePercent member of the SYSTEM_POWER_STATUS structure?
Sep 24, 2010
Post comments count 0
Post likes count 0

How reliable is the BatteryLifePercent member of the SYSTEM_POWER_STATUS structure?

Raymond Chen
Raymond Chen

A customer was writing a program that called and used the value. The customer wanted to know whether a reported battery life percentage of 38% really means that the remaining battery life is between 37.5% and 38.5%. Although the value is reported to 1% precision, the accuracy in practice is much worse. Similarly, the is reported in seconds, but if your battery actually lasts exactly the amount of time predicted by that field (and not a second longer or shorter), it's almost certainly a fluke. Even a stopped clock is right twice a day. These battery levels come from the hardware itself, so you are at the mer...

Pizza: The reference food for young children
Sep 23, 2010
Post comments count 0
Post likes count 0

Pizza: The reference food for young children

Raymond Chen
Raymond Chen

One way to convince a child to try out an unfamiliar food is to say that it's an alternate form of pizza. Here are some examples. Feel free to add more in the comments. I had originally listed crêpe as French pizza, then realized it's more like a French pancake. (I wonder what the Italian version of pizza would be...)

You must flush GDI operations when switching between direct access and GDI access, and direct access includes other parts of GDI
Sep 23, 2010
Post comments count 0
Post likes count 0

You must flush GDI operations when switching between direct access and GDI access, and direct access includes other parts of GDI

Raymond Chen
Raymond Chen

A customer was running into problems when accessing the pixels of a DIB section. They used the parameter to and created two bitmaps from the same underlying memory. Those two bitmaps were then selected into corresponding DCs, and the customer found that changes to the pixels performed by writing via one DC were not visible when read from the other DC. The customer pointed out this clause in MSDN: You need to guarantee that the GDI subsystem has completed any drawing to a bitmap created by before you draw to the bitmap yourself. Access to the bitmap must be synchronized. Do this by calling the function. T...

Happy Mid-Autumn festival 2010
Sep 22, 2010
Post comments count 0
Post likes count 0

Happy Mid-Autumn festival 2010

Raymond Chen
Raymond Chen

The other day, I told my niece that I would be eating a moon cake on Wednesday. She asked, "Why? Is it your birthday?" For the record, my favorite flavor is red bean paste. Bonus chatter: The underground economy of moon cakes, moon cake vouchers, and how moon cakes are like fruitcake.

What is the effect of the /LARGEADDRESSAWARE switch on a DLL?
Sep 22, 2010
Post comments count 0
Post likes count 0

What is the effect of the /LARGEADDRESSAWARE switch on a DLL?

Raymond Chen
Raymond Chen

Nothing. Large-address-awareness is a process property, which comes from the EXE.

Fact check: The first major Microsoft product launched via Webcast
Sep 21, 2010
Post comments count 0
Post likes count 0

Fact check: The first major Microsoft product launched via Webcast

Raymond Chen
Raymond Chen

In 2009, while hosting the Webcast launch of Office Communications Server 2007 R2 (what a mouthful; no wonder they renamed it Lync), Stephen Elop claimed that this was the first time Microsoft had launched a major product via Webcast. Elop's crack team of marketing researchers apparently forgot about the Webcast launch, just three months earlier, of Windows Small Business Server 2008. Maybe somebody can find an even earlier Webcast launch of a major Microsoft product. (Perhaps Elop is claiming that Small Business Server is not a major product, but by that standard, neither is Office Communications Server, w...