September 17th, 2008

Well at least that’s one fewer program that relies on window handles being even numbers

Earlier this year I received a piece of email from a programmer at a major software firm, reprinted below (suitably redacted) with permission. It was a sort of a mea culpa. (Remember: no guessing allowed.)

Hi, Raymond.

I’m a dev on Product X and recently we were sitting around having a beer after work, discussing the long and sordid history of our code base, and an interesting factoid came up that you might be interested in. Apparently, when we were writing Version 1 of our program many years ago when buffalo roamed the earth, window handles were always even numbers for whatever reason. We relied on that when we created our user interface library and interpreted any handle that was odd as coming from our library and even ones as belonging to Windows. This “functionality” has been sitting in our code base through all our releases.

Just letting you know that we finally got rid of this dependency. You can finally use those odd handles once the next version of Product X comes out and the current version falls out of support. Should only take five years, ten tops.

Sorry about all the trouble this caused. I’m surprised (and grateful) that you guys keep working as hard as you do on what I’ll call Stupid-Dependencies-On-Undocumented-Features.

One down, who-knows-how-many to go.

Topics
History

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.