The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Oct 6, 2008
Post comments count 0
Post likes count 3

Eventually, nothing is special any more

Raymond Chen

Commenter ulric suggested that two functions for obtaining the "current" window should exist, one for normal everyday use and one for "special use" when you want to interact with windows outside your process. I'd be more at ease however if the default behaviour of the API was to return HWND for the current process only, and the apps that really need HWND from other potentially other processes would have to be forced to use another API that is specifically just for that. This is an excellent example of suggesting something that Windows already does. The special function has become so non-special, you don't ...

Oct 3, 2008
Post comments count 0
Post likes count 0

Stories of crossing into Canada: The wedding

Raymond Chen

When I cross the border into Canada, there's almost always a story. Rarely is there an uneventful crossing. In 2007, I attended a wedding in Vancouver, BC, and here's how the conversation went at the border crossing into Canada: Me: Good morning. (As I hand over passports and green cards for everybody in the car.) Border guard: Hello. What is the purpose of your visit? Me: A wedding. Border guard: How long will you be in Canada? (Looks over the documents and compares the faces against the people in the car.) Me: Just one day. Border guard: Bringing any gifts? I didn't bring any gifts (in t...

Oct 3, 2008
Post comments count 0
Post likes count 1

Acquire and release sound like bass fishing terms, but they also apply to memory models

Raymond Chen

Many of the normal interlocked operations come with variants called InterlockedXxxAcquire and InterlockedXxxRelease. What do the terms Acquire and Release mean here? They have to do with the memory model and how aggressively the CPU can reorder operations around it. An operation with acquire semantics is one which does not permit subsequent memory operations to be advanced before it. Conversely, an operation with release semantics is one which does not permit preceding memory operations to be delayed past it. (This is pretty much the same thing that MSDN says on the subject of Acquire and Release Semantics....

Oct 2, 2008
Post comments count 0
Post likes count 1

The dangers of setting your double-click speed too short

Raymond Chen

After I noted how the window manager uses the double-click time as a basis for determining how good your reflexes are, people got all excited about reducing the double-click speed to make Windows feel peppier. But be careful not to go overboard. Back in the Windows 95 days, we got a bug from a beta tester that went roughly like this: Title: Double-clicks stop working after using mouse control panel Reproducibility: Consistent, hardware-independent Severity: Major loss of functionality Description: Result: Mouse double-clicks no longer recognized. We had to explain to the beta tester that, no,...

Oct 1, 2008
Post comments count 0
Post likes count 0

An artist’s conception of the new citizenship test

Raymond Chen

Today is the first day of the controversial redesigned United States citizenship examination. For the next year, candidates who applied before today can choose whether they want to use the old test or the new one. To help prepare for the new examination, I propose the following warm-up, which I tested (with the assistance of another United States citizen) on a foreign national, a Canadian from British Columbia, so there should be no language barrier as long as we are careful to avoid the word about. Here are the answers the Canadian gave, along with my response and additional commentary from my co-examiner ...

Oct 1, 2008
Post comments count 0
Post likes count 1

Why do maximized windows lose their title bar translucency?

Raymond Chen

If you have translucent title bars enabled,¹ you may have noticed that the translucency goes away when you maximize a window. Why is that? This is a performance optimization. Opaque title bars are more efficient than translucent ones, and when you maximize a window, you're saying,² "I want to focus entirely on this window and no other windows really matter to me right now." In that case, the desktop window manager doesn't bother with translucency because you're not paying any attention to it anyway. This may seem like a very minor change, but the difference is noticeable on benchmarks, and, like...

Sep 30, 2008
Post comments count 0
Post likes count 1

2008 Q3 link clearance: Microsoft blogger edition

Raymond Chen

It's that time again: Sending some link love to my colleagues. [Raymond is currently away; this message was pre-recorded.]

Sep 30, 2008
Post comments count 0
Post likes count 1

When computer programmers dabble in economics: Buying prepaid lunch vouchers

Raymond Chen

Several years ago, the Microsoft cafeterias phased out their prepaid lunch voucher system. Under the new system, you "load up" your security badge with money (either by paying cash at any register or by having the amount deducted from your paycheck) and then swipe your badge at card readers installed at each register. But in the old days, the system operated manually. Under the old system, you paid $25 cash for a voucher which, when folded in half, was about the size of a business card. On the card were boxes with various denominations ($1, 25¢, 10¢, 5¢), and when you bought something with your ...

Sep 29, 2008
Post comments count 0
Post likes count 0

Meet the authors: Mario Hewardt and Daniel Pravat, authors of Advanced Windows Debugging

Raymond Chen

My colleague Mario Hewart just let me know that he and Daniel Pravat will be presenting at the PDC pre-con. In case you don't recognize the names, they're the authors of Advanced Windows Debugging, a book which I reviewed late last year. So if you want to get your debugging tips directly from the source, you know where to go. Besides, Mario speaks Swedish, so he's already awesome by default. [Raymond is currently away; this message was pre-recorded.]