Raymond Chen

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.

Post by this author

The various ways of sending a message

There are several variations on the SendMessage function, but some are special cases of others. The simplest version is SendMessage itself, which sends a message and waits indefinitely for the response. The next level up is SendMessageTimeout which sends a message and waits for the response or until a certain amount of time has elapsed...

Am I sorry or not?

One of the consequences of the New Internet World Order is that it is very easy to set up a web site like www.sorryeverybody.com and equally easy to set up a response like www.notsorryeverybody.com. This state of affairs clearly calls out for some sort of competition between the two. At dinner last night, someone suggested that there should ...

If a program and a folder have the same name, the shell prefers the program

If you have both a folder named, say, and a program named and you type into the Start.Run dialog, you get the program and not the folder. Why is that? Because it is common to have where there is a setup program in the root, as well as a setup folder containing files needed by the setup program. Before Windows 95, you couldn't...

Poking at diploma mills: Kennedy-Western University

I enjoy poking around diploma mills. Especially the ones that spam my inbox. Like Kennedy-Western University, which describes itself like so: Since 1984 Kennedy-Western University (KWU) has provided distance and online degree programs to over 30,000 students. KWU is one of the largest non-accredited online universities in the United States...

How do I break an integer into its component bytes?

Warning: .NET content ahead. For some reason, this gets asked a lot. To break an integer into its component bytes, you can use the BitConverter.GetBytes method: int i = 123456; byte[] bytes = BitConverter.GetBytes(i); After this code fragment, the byte array contains { 0x40, 0xE2, 0x01, 0x00 }. Update 11am: The endian-ness ...

Exploiting the inattentive

The makers of a certain major brand of detergent which I will not name (but which for the purposes of this discussion will be called "Snide") appears to take every step to exploit inattentive customers. A box of Snide detergent powder comes with instructions indicating that for a normal-sized load, you should use 3/8 cup of detergent; for a ...

What is this Xerox directory doing in Program Files?

If you go snooping around, you may find an empty directory. What's that for? This directory is being watched by Windows File Protection, because it needs to protect the file should it ever show up. (Why does the directory have to exist in order for Windows File Protection to be able to watch it? I'm told it's a limitation of the Windows ...

Asking questions where the answer is unreliable anyway

Here are some questions and then explanations why you can't do anything meaningful with the answer anyway even if you could get an answer in the first place. "How can I find out how many outstanding references there are to a shared memory object?" Even if there were a way to find out, the answer you get would be instantly wrong anyway ...

Will dragging a file result in a move or a copy?

Some people are confused by the seemingly random behavior when you drag a file. Do you get a move or a copy? And you're right to be confused because it's not obvious until you learn the secret. Mind you, this secret hasn't changed since 1989, but an old secret is still a secret just the same. (Worse: An old secret is a compatibility ...

Advantages of knowing your x86 machine code

Next time you find yourself debugging in assembly language (which for some of us is the only way we debug), here are some machine code tricks you may wish to try out: 90 This is the single-byte NOP opcode. If you want to patch out code and don't want to think about it, just whack some 90's over it. To undo it, you have to patch ...