The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

May 3, 2011
Post comments count 0
Post likes count 1

That's not a duck

Raymond Chen

One of the audio features added to Windows 7 goes by the formal name stream attenuation, but it is more commonly known to people in the audio world as ducking. Ducking is the process of lowering the volume of background sounds in order to draw more attention to the foreground sound. For example, when you're watching a big battle scene in a summer action movie, your ears are assaulted with the sounds of weapons fire, objects exploding left and right, but when the hero turns to his girlfriend-of-the-moment, the sound level of all the death and destruction drops a bit so you can hear him say something tender,...

May 2, 2011
Post comments count 0
Post likes count 0

The Importance of Being Snooki

Raymond Chen

What if Jersey Shore were actually a play written by Oscar Wilde? Algernon Moncrieff and Jack Worthing from Broadway's current production of The Importance of Being Earnest explore that premise in a five-part series titled "Jersey Shore" Gone Wilde, drawing its dialogue from things actually said on "Jersey Shore". The dialogue and delivery are funny enough. But what really sells it is the acting: The eye rolls, the nervous glances, the blank stares... Warning: NSFW for crude language, so I didn't embed the videos. You'll have to click through.

May 2, 2011
Post comments count 0
Post likes count 1

Hidden compatibility constraints of redirecting program execution via a stub

Raymond Chen

One of the "obvious" solutions to the issue of how much work you're willing to do to save 68KB of disk space was to replace one of the copies with a stub that launches the other copy. If you try this obvious solution, you may run into some compatibility issues. First of all, there are programs which launch Notepad and then wait on the process handle so they can wait until the user closes Notepad. Your stub program cannot just do a on the target, because programs which perform a wait will find the wait satisfied when your stub program exits. Okay, so your stub program has to wait for the real copy of Notepa...

Apr 29, 2011
Post comments count 0
Post likes count 1

Not quite understanding why you wash your hands before playing the piano

Raymond Chen

My niece wanted to play my piano, and I asked her to wash her hands. She said, "I don't need that, I have Magic Soap," and she produced a bottle of hand sanitizer. Um, the purpose of washing your hands isn't so the piano doesn't get sick. My piano-instructor cousin-in-law tells me that her young students often say, "My hands are not dirty. They are just a little sticky because I just ate a chocolate muffin on my way here. I don't think I need to wash my hands. Why do you always ask me to wash my hands before the piano lesson?"

Apr 29, 2011
Post comments count 0
Post likes count 1

Why is there a RestoreLastError function that does the same thing as SetLastError?

Raymond Chen

Matt Pietrek noticed that and do exactly the same thing and wondered why there's a separate function for it. It's to assist in debugging and diagnostics. Say you're debugging a problem and when you call you get . It would really help a lot if you could figure out who set the error code to . If you set a breakpoint on , you find that people call for two different reasons: That second one needs a little explanation. You might have a logging function that goes like this: It's important that functions which perform logging, assertion checking, and other diagnostic operations are nonintrusive. You don...

Apr 28, 2011
Post comments count 0
Post likes count 1

Microspeak: Hipo

Raymond Chen

A friend of mind was asked out of the blue, "What does hypo mean?" She started to flash back to high school English class and Greek word roots. "I've started to hear it everywhere. Like Everyone in that meeting is a hypo or We need to reach out to hypos." My friend realized that she had mis-heard the question. It was not about the Greek root hypo but rather the bizarro Microspeak word hipo, shorthand for high-potential employee. As I researched this term (which I had never encountered before), I found that it fell into that special category of Microspeak known as if you have to ask, I'm not going to tell you....

Apr 27, 2011
Post comments count 0
Post likes count 1

How do I pin a program directly to the Start menu rather than a shortcut?

Raymond Chen

Anonymous bemoans the fact that pinning programs to the Start menu (in Windows XP) actually pins the shortcut rather than the program itself. This means that if you right-click on a shortcut to pin it, then delete the shortcut, the pinned item stops working. How do you pin the program directly? You pin the program directly by right-clicking on the program directly. If you right-click on a shortcut and select Pin to Start menu, then you're pinning the shortcut. This is sort of obvious, because after all, that's what you right-clicked on. If you want to pin the raw program, then dive into the Program Files f...

Apr 26, 2011
Post comments count 0
Post likes count 1

No, you can't ask whether your notification icon is visible or not

Raymond Chen

A customer asked what started out as a simple question, but by now you know that this sort of simple question only raises new questions: Is there a way that we can detect that the user has hidden our notification icon? No, there is no way to ask whether your notification icon is hidden or visible. Users decide which icons they want to see, and you don't get to snoop in on the users' decisions. Questions like this scare me, because it sounds like this customer's program is going to respond to the user's choice to hide their icon by doing something even more annoying. This is another demonstration of Le Chatel...

Apr 25, 2011
Post comments count 0
Post likes count 1

There's only so much you can do to stop running code from simulating UI actions

Raymond Chen

Commenter KiwiBlue asks whether Captcha-style tests were considered to prevent unsigned drivers from programmatically clicking the 'Install anyway' button. I'm sure somebody considered it, but Captcha has its own problems. "Type the (distorted) letters below"-type Captcha cannot be used by people with visual impairments, people who are dyslexic, or people who simply are not familiar with the Latin alphabet. (Believe it or not, the vast majority of people on the planet have a native language which does not use the Latin alphabet.) Using an audio captcha runs into the problem of different accents, letters whose ...