The Old New Thing

The migration continues
The migration continues
Hey folks, this blog is moving to a new home. It'll take me a while to set up shop there, though, so please be patient. Some time after the new year, the content will likely migrate to the new location.
Welcome to the New Old New Thing
Welcome to the New Old New Thing
Hey there, everybody. It's going to take me a while to settle in, so please be patient. It seems I always celebrate a new blog by designing some insane multi-part series on some obscure aspect of Win32, so I think I'll welcome this site with a series of articles that demonstrate various things you can do with the shell namespace. I haven't pla
Tote Hose in Weilburg
Tote Hose in Weilburg
Wenn Teenies shoppen gehen: Flugzeuge im Warenkorb. This article caught my eye because it opens with a German slang phrase I learned just a few weeks ago: "Tote Hose" which means roughly "Absolutely nothing doing". Here's an English version of the article for those whose German isn't quite up to sn
Why are structure sizes checked strictly?
Why are structure sizes checked strictly?
You may have noticed that Windows as a general rule checks structure sizes strictly. For example, consider the MENUITEMINFO structure: Notice that the size of this structure changes depending on whether WINVER >= 0x0500 (i.e., whether you are targetting Windows 2000 or higher). If you take the Windows 2000 version of this structure and
Voyage to Our Hollow Earth
Voyage to Our Hollow Earth
Slashdot's story about the amateur adventurer who is now stranded at McMurdo Base (because he underestimated his fuel requirements for a trip over the South Pole) reminded me of a controversy abrew at the other end of the planet: The hole at the North Pole. To resolve this matter, Steve Cur
How do I pass a lot of data to a process when it starts up?
How do I pass a lot of data to a process when it starts up?
As we discussed yesterday, if you need to pass more than 32767 characters of information to a child process, you'll have to use something other than the command line. One method is to wait for the child process to go input idle, then FindWindow for some agreed-upon window and send it a WM_COPYDATA message. This method has a few problems:
What is the command line length limit?
What is the command line length limit?
It depends on whom you ask. The maximum command line length for the CreateProcess function is 32767 characters. This limitation comes from the UNICODE_STRING structure. CreateProcess is the core function for creating processes, so if you are talking directly to Win32, then that's the only limit you have to worry about. But if you are reachi
Scoble's rant on UI defaults
Scoble's rant on UI defaults
Robert Scoble posted an entry in his Longhorn blog on the subject of what the UI defaults should be. It sure has stirred up a lot of controvery. I may pick at the remarks over the upcoming days, but for now I posted responses to two of the comments he kicked up. We recently did a survey of users
Why you should never suspend a thread
Why you should never suspend a thread
It's almost as bad as terminating a thread. Instead of just answering a question, I'm going to ask you the questions and see if you can come up with the answers. Consider the following program, in (gasp) C#: When you run this program and hit Enter to suspend, the program hangs. But if you change the worker function to just "for(;;) {}"
If FlushInstructionCache doesn't do anything, why do you have to call it?
If FlushInstructionCache doesn't do anything, why do you have to call it?
If you look at the implementation of FlushInstructionCache on Windows 95, you'll see that it's just a return instruction. It doesn't actually do anything. So why do you have to call it? Because the act of calling it is the whole point. The control transfers implicit in calling a function suffice to flush the instruction cache on a Pentium. T