The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Why didn't Windows XP auto-elevate programs beyond those named setup.exe?
Jul 26, 2010
Post comments count 0
Post likes count 0

Why didn't Windows XP auto-elevate programs beyond those named setup.exe?

Raymond Chen
Raymond Chen

Commenter J-F has a friend who wonders why Windows XP didn't auto-elevate all installers but rather only the ones named setup.exe. (Perhaps that friend's name is Josh, who repeated the question twelve days later.) Remember what the starting point was. In Windows 2000, nothing was auto-elevated. Before adding a feature, you have to know what problem the feature is trying to solve. The problem is improving the experience for non-administrators who want to install software. When they try to install a program and forget to use the Run as feature, then instead of proceeding halfway through the installer ...

MSDN content is also available as a Web service
Jul 23, 2010
Post comments count 0
Post likes count 0

MSDN content is also available as a Web service

Raymond Chen
Raymond Chen

Unless you've been living under a rock, by now you know about MSDN's low bandwidth view (aka ScriptFree) and lightweight view. But there are other views too, like PDA view (for when you want to look up MSDN documentation on your phone?), Robot view, printer-friendly view, unstyled HTML view... (See that first link above for more details.) But in addition to all the views, you can go directly to the back-end that drives all the data: The MSDN/TechNet Publish System (MTPS) Content Service. With that interface, you can request the back-end data and format it any way you like. Here's an MSDN Magazine article wh...

If I'm not supposed to call IsBadXxxPtr, how can I check if a pointer is bad?
Jul 23, 2010
Post comments count 0
Post likes count 1

If I'm not supposed to call IsBadXxxPtr, how can I check if a pointer is bad?

Raymond Chen
Raymond Chen

Some time ago, I opined that should really be called and you really should just let the program crash if somebody passes you a bad pointer. It is common to put pointer validation code at the start of functions for debugging purposes (as long as you don't make logic decisions based on whether the pointer is valid). But if you can't use , how can you validate the pointer? Well, to validate a write pointer, write to it. To validate a read pointer, read from it. If the pointer is invalid, you'll crash, and at a predictable location, before the function has gotten halfway through its processing (making post-mort...

I will be speaking at TechReady11
Jul 22, 2010
Post comments count 0
Post likes count 0

I will be speaking at TechReady11

Raymond Chen
Raymond Chen

This year, it's advanced debugging.

Things I've written that have amused other people, Episode 7
Jul 22, 2010
Post comments count 0
Post likes count 0

Things I've written that have amused other people, Episode 7

Raymond Chen
Raymond Chen

A customer asked for advice on how to accomplish something, the details of which are not important, except to say that what they were trying to do was far more complicated than the twenty-word summary would suggest. And I wasn't convinced that it was a good idea, sort of like asking for advice on how to catch a baseball in your teeth or pick all the cheese off your cheeseburger. I explained several of the pitfalls of their approach, the ones that I could think of off the top of my head, things they need to watch out for or take precautions against, and I concluded with the sentence, "This idea is fraught with p...

No, you can't lock a gadget to the top of the sidebar
Jul 21, 2010
Post comments count 0
Post likes count 0

No, you can't lock a gadget to the top of the sidebar

Raymond Chen
Raymond Chen

In another installment of I bet somebody got a really nice bonus for that feature, I offer you this customer: My customer has created a Windows Vista sidebar gadget and wants to know if there's a way to force this gadget to appear at the top of the sidebar and prevent the user from moving or removing it. I applaud this company for having written the most awesome sidebar gadget in the history of the universe. It's so compelling that it should override the user's preferences and force itself into the upper right corner of their screen in all perpetuity. Unfortunately, Windows was not prepared for a program as ...

Suggestion Box 4
Jul 20, 2010
Post comments count 0
Post likes count 0

Suggestion Box 4

Raymond Chen
Raymond Chen

The topic backlog from Suggestion Box 3 has nearly cleared out, and I've actually been enjoying not having to write up a reply every Monday for the past several months, but all good things must come to an end, and so, without much fanfare, we now have Suggestion Box 4. Remember, the suggestion box is for suggestions for future topics. It isn't for developer support, bug reports, or ranting. Topics I'm inclined to cover: Topics I am not inclined to cover: Selected products at Microsoft participate in the Connect program, and many more have official blogs. Suggestions should be between two and fo...

Management-speak: Multi-perspective content
Jul 20, 2010
Post comments count 0
Post likes count 0

Management-speak: Multi-perspective content

Raymond Chen
Raymond Chen

A colleague of mine visited an internal Web site for task ABC and found that the site was no longer there. Instead it was replaced with a simple message: Designed with the user in mind you will now find contextual ABC and DEF information served up in a secure format alongside all GHI information. Access to relevant multi-perspective content will enable faster resolution for your GHI needs. Translation:

To enable and disable a window, use the EnableWindow function
Jul 19, 2010
Post comments count 0
Post likes count 0

To enable and disable a window, use the EnableWindow function

Raymond Chen
Raymond Chen

Commenter Chris 'Xenon' Hanson points out that fiddling with the style directly via leads to strange behavior. However it isn't the case that "most widget classes work fine." Reaching in and fiddling the style bit directly is like reaching into a program's internal variables and just changing the values: All the other work that is associated with changing the value simply doesn't happen. It's like taking a book you checked out of the library, re-shelving it, and then going into the library computer and marking it as "returned". The bookkeeping will say that the book has been returned, but all the other proce...