The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Creative armed robbery defense: Political asylum
Jul 16, 2007
Post comments count 0
Post likes count 0

Creative armed robbery defense: Political asylum

Raymond Chen
Raymond Chen

Step 1: Rob bank. Step 2: Flee the country. Step 3: Claim political asylum because the robbery was a form of political protest. It's creative, I have to grant you that. The theory is that Canadian law prohibits extradition for political crimes. Though it's a strange defense to say "If I did it, it was politically motivated." Isn't the whole point of a political protest to openly admit to the crime and invite the authorities to arrest you? If you deny doing it, then it isn't much of a political statement, now, is it? I mean, you don't hear on the news, "A bomb exploded in ABC today. The radi...

How are window manager handles determined in 16-bit Windows and Windows 95?
Jul 16, 2007
Post comments count 0
Post likes count 0

How are window manager handles determined in 16-bit Windows and Windows 95?

Raymond Chen
Raymond Chen

(Prefatory remark: The following information is of the "behind the scenes" nature and does not constitute formal documentation. Actually, nothing I write counts as formal documentation, so I shouldn't have needed to write that, but people sometimes intentionally play stupid and interpret all forms of the future tense as if I were making some sort of "guarantee" on behalf of Microsoft Corporation. I assure you that I have no such authority! It's times like that that I'm tempted to just give up writing.) Let's start with 16-bit window handles. Those are simple: They are just pointers into the window manager's dat...

The dangers of conversation fragments: Overheard on the Burke-Gilman trail
Jul 13, 2007
Post comments count 0
Post likes count 0

The dangers of conversation fragments: Overheard on the Burke-Gilman trail

Raymond Chen
Raymond Chen

This past weekend, a group of us went on one last training ride before the STP, which begins tomorrow. The Burke-Gilman is a multipurpose trail, with bicyclists sharing the path with walkers, joggers, inline skaters, sometimes even people on horseback. (Inline nitpicker's corner: The horseback riders are on the Sammamish River Trail, which is technically a different trail from the Burke-Gilman even though the two connect seamlessly.) As you cycle past a group, you can sometimes catch a few words of conversation. Usually, those words are not noteworthy at all. "...said to her..." or "...opened up..." or "...when...

I was sort of interested at first, but now I'm not so sure any more
Jul 13, 2007
Post comments count 0
Post likes count 0

I was sort of interested at first, but now I'm not so sure any more

Raymond Chen
Raymond Chen

Some time ago, there was a product under development that was starting to get some buzz, so I thought I'd go check it out. I went to the product's Web site, but the product was so new that they didn't have any substantial information available. The only way to learn about the product was to download the documentation. And before they would let me do that, I had to register with my email address and some demographic information. I closed the window and never went back. Now, if the registration page had told me why they wanted this information, I might have offered it. Maybe because the product was still under de...

Seattle street signs for sale, used, but for ten bucks you can't complain
Jul 12, 2007
Post comments count 0
Post likes count 0

Seattle street signs for sale, used, but for ten bucks you can't complain

Raymond Chen
Raymond Chen

The city of Seattle has begun a nine-year program of upgrading its street signs, and the city has decided to make the old signs available to the public for purchase. When you see the signs on your street replaced, you can go to the Buy a Sign page to buy the old one. It looks like signs in average condition are going for $10, whereas signs in below average condition go for $5. Unsold signs will be turned to scrap. Signs for famous streets such as Pike and Pine will be auctioned off on eBay. If street signs aren't your thing, you can buy old parking meters for $10–$15 (listed under "Miscellaneous").

If you want a modeless dialog, then create a modeless dialog already
Jul 12, 2007
Post comments count 0
Post likes count 0

If you want a modeless dialog, then create a modeless dialog already

Raymond Chen
Raymond Chen

Somebody I'd never heard of sent me email with a general programming question. (This is one of the top ways of instantly making me not interested in talking to you.) I have a modal dialog box which I hide with , and I want to enable the parent window so the parent window will get focus and keyboard input. Is this possible? If so, how do I do it? MSDN says "Although a dialog box procedure could potentially enable the owner window at any time, enabling the owner defeats the purpose of the modal dialog box and is not recommended." How do I go about enabling the parent window? This is like asking for a cheeseburg...

Those who do not understand history are doomed to repeat it… on YouTube
Jul 11, 2007
Post comments count 0
Post likes count 0

Those who do not understand history are doomed to repeat it… on YouTube

Raymond Chen
Raymond Chen

What happens if you build a wooden horse, put some soldiers inside it, and then ask security guards if you can leave it overnight inside their complex?

How to check for errors from SetFilePointer
Jul 11, 2007
Post comments count 0
Post likes count 0

How to check for errors from SetFilePointer

Raymond Chen
Raymond Chen

The function reports an error in two different ways, depending on whether you passed as the parameter. The documentation in MSDN is correct, but I've discovered that people prefer when I restate the same facts in a different way, so here comes the tabular version of the documentation. I'd show some sample code, but the documentation in MSDN already contains sample code both for the case as well as the case. A common mistake is calling even if the return value is not . In other words, people ignore the whole part of the "did the function succeed or fail?" test. Just because returned an error code does...

That leaves more hot German babes for me!
Jul 10, 2007
Post comments count 0
Post likes count 0

That leaves more hot German babes for me!

Raymond Chen
Raymond Chen

Controversial new German law requires non-EU members to be able to speak German before they can move to the country to join their spouse.