The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

May 25, 2009
Post comments count 0
Post likes count 1

Why can’t you change the alignment of an edit control after it has been created?

Raymond Chen

Commenter Kevin Eshbach asks why you cannot programatically change the text centering style of an edit control after the control has been created. The edit control is one of the original window manager controls, so it comes with a lot of history. First thing to note is that the message did not exist until Windows 95. The edit control predates Windows 95 by over a decade, so the short answer is "It can't respond to the change in styles because it doesn't even know that you changed them!" Back in the old days, the only time a control was informed of its styles was in the passed as parameters to th...

May 22, 2009
Post comments count 0
Post likes count 0

Chicken chicken chicken chicken

Raymond Chen

Chicken chicken chicken chicken. [pdf] Chicken: Chicken chicken chicken.

May 22, 2009
Post comments count 0
Post likes count 1

If an event is signaled more than once, are they delivered in the order in which they were signaled?

Raymond Chen

A customer asked the following question: Is it guaranteed that the events when signaled multiple times on an event object are delivered in the order in which they were signaled? For example, a thread is waiting on the event handle and performs some operation each time it is signaled. The ordering of those operations should be in the same order in which the event is signaled. Do events provide this guarantee? In case it matters, we're using an auto-reset event. We're finding issues when the system is under heavy load. This question is confusing because events don't "remember" who signaled them. When an ev...

May 21, 2009
Post comments count 0
Post likes count 1

First, try reading the error message: Episode 1

Raymond Chen

Quite some time ago, a customer had forgotten that they were using an evaluation edition of Windows, and they were awakened one morning with the following error message: The evaluation period for this installation of Windows has expired. This system will shut down in 1 hour. To restore access to this installation of Windows, please upgrade this installation using a licensed distribution of this product. The customer submitted an urgent request for assistance. "Please advise how we can get this machine working again. We need it to run a demo for a major client later this week." In the customer's panic, th...

May 20, 2009
Post comments count 0
Post likes count 0

Signs that your new building was originally designed for another purpose: Rest rooms

Raymond Chen

There's always a settling-in period when you move offices, learning where things are, like the rest room, the kitchen, the printer room, the cafeteria, the locker room, your boss... My new office is conveniently close to the rest room. Actually, this building is laid out kind of weird. There are two sets of rest rooms within a short distance of each other, on opposite sides of a stairwell. You can wave hello from one to the other and have a conversation. My office is nearly halfway between them. But I can use only one of them. On the south side, there are two rest rooms, a men's room and a women's room. On t...

May 19, 2009
Post comments count 0
Post likes count 1

Just letting you know I had to reboot my telephone

Raymond Chen

Shortly after my group got switched over to new fancy-dancy IP phones, one of my colleagues sent me email to say "This morning, when I picked up the phone, I kept getting a 'URL not allowed' error. I fixed it by rebooting my phone." So this is what the world has come to. Bonus chatter: As many readers surmised, these "new" IP phones arrived over a year ago. On the other hand, I never did get to learn all the features of the device before it was replaced with a different model of IP phone. Progress.

May 18, 2009
Post comments count 0
Post likes count 1

How do I know whether a window message was processed?

Raymond Chen

Commenter Skeets Norquist asks how to tell whether the original window procedure processed a message when you use to call the original window procedure. "CallWindowProc() always seems to return an LRESULT of 0." No, actually, returns whatever the window procedure did. If the window procedure returned zero, then returns zero. If the window procedure returned 5, then returns 5. Anyway, back to the original question. You actually know the answer, if you think about it the right way, and there are many right ways of thinking about it. Technique number 1: Reading the contract from the other side. ...

May 15, 2009
Post comments count 0
Post likes count 1

Windows Vista User Experience Guidelines is online and downloadable

Raymond Chen

Get it before it's obsolete. The Windows Vista User Experience Guidelines document is available in PDF format.

May 15, 2009
Post comments count 0
Post likes count 0

Imagine our luck when we found one of the fancy conference rooms available for our meeting

Raymond Chen

Some time ago, the group I was a member of was looking for a conference room in which to hold their weekly team status meeting. The group leader went to the so you want to book a conference room for your weekly meeting internal Web site and, hey wow, there was a slot available in one of the fancy conference rooms for Tuesdays at ten in the morning. Not all conference rooms are created equal. Most of them are pretty utilitarian in nature with a central table, standard-issue chairs, a speaker phone, a whiteboard against one wall, all the stuff you need for a meeting but nothing particularly noteworthy. But in thi...