The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Feb 26, 2009
Post comments count 0
Post likes count 1

Pressing a registered hotkey gives you the foreground activation love

Raymond Chen

One category of application that people complained about is the application launcher which keys off a hotkey and doesn't get the foreground love. Well, except that windows with registered hotkeys do get the foreground love. After you call the function to register a hotkey, the window manager will send you a message when the user presses that hotkey, and along with it, you will get the foreground love. If you call from inside your hotkey handler, the foreground window will change according to your instructions. A special administrator-only list of programs which are exempt from rules would just be ad...

Feb 25, 2009
Post comments count 0
Post likes count 0

Star Trek meets The A-Team

Raymond Chen

Rumors swirl that there's a movie version of The A-Team in the works. If they haven't decided on the casting yet, here's an option they may have overlooked: The cast of Star Trek. (I like how in the clips used in the fake trailer, they use one of an episode where Kirk is old. And in Hollywood, making a character older means graying their hair. They never gain weight when they age, unlike the actors themselves.)

Feb 25, 2009
Post comments count 0
Post likes count 0

Smart quotes: The hidden scourge of text meant for computer consumption

Raymond Chen

They look pretty but act differently.

Feb 24, 2009
Post comments count 0
Post likes count 0

Rob Cockerham investigates those companies that pay cash for gold

Raymond Chen

Rob Cockerham seems to have a lot of spare time, which is great for the rest of us, because he investigates all those things we simply don't have the time for, and then posts the results on his Web site ("The sixth-best website in the world"). Today's highlight is a pair of investigations he performed some time ago which seem to show two sides of one industry. That Web site is a sinkhole of time-wastage. If you're not careful, you'll find yourself clicking around from story to story, like the How much is inside? adventures, in which he investigates things like how many threads per inch are there in 360-thr...

Feb 24, 2009
Post comments count 0
Post likes count 1

Email tip: Just because you get answers when you misuse a mailing list doesn’t doesn’t mean you should continue to misuse it

Raymond Chen

A few years ago, there was a question on a mailing list for topic X, but the question was about unrelated topic Y. The question was nevertheless answered by the people on the topic X mailing list out of the kindness of their hearts (above and beyond the heart-sourced kindness that powers most mailing lists in the first place). I pointed out that the question really had nothing to do with topic X, and consequently the Y-Users list was a better place for the question. The person responded, Yes, I know, but X-Users always provides a quick reply and a quick solution. In other words, the pe...

Feb 23, 2009
Post comments count 0
Post likes count 1

Why is there no supported way to get the command line of another process?

Raymond Chen

Commenter Francisco Moraes wonders whether there is a supported way of getting the command line of another process. Although there are certainly unsupported ways of doing it or ways that work with the assistance of a debugger, there's nothing that is supported for programmatic access to another process's command line, at least nothing provided by the kernel. (The WMI folks have come up with Win32_Process.CommandLine. I have no idea how they get that. You'll have to ask them yourself.) That there isn't is a consequence of the principle of not keeping track of information which you don't need. The kernel has...

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

Announcements on the ferry, and hills that grew while I was away

Raymond Chen

This weekend is the annual Chilly Hilly bike ride, an early wake-up call to bicyclists in the Seattle area to get their act together and hit the road. Last year, I joined my 2999 closest friends up and down the hills of Bainbridge Island. Unfortunately, the hills had grown taller in the two years since my last ride. There was an announcement on the ferry. It went something like this: "Your attention please. There is a bicycle on the car deck that has fallen over onto its side. Repeat: A bicycle has fallen onto its side." It took a few seconds for the joke to sink in with all the people on the ferry, ...

Feb 20, 2009
Post comments count 0
Post likes count 1

Foreground activation permission is like love: You can’t steal it, it has to be given to you

Raymond Chen

This is the blog entry that acted as the inspiration for the last topic in my 200 PDC talk. When somebody launches a second copy of your single-instance program, you usually want the second copy to send its command line to the first instance (and deal with the current directory somehow), and then you want the first instance to come to the foreground. But a common problem people run into is that when the first instance calls , it fails. The problem with this design is that as far as the window manager is concerned, what happened is that the first instance received a message and then decided to steal foregr...

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

Why do my file properties sometimes show an Archive check box and sometimes an Advanced button?

Raymond Chen

When you view the properties of a file and go to the General page, there are some check boxes at the bottom for file attributes. There's one for Read-only and one for Hidden, and then it gets weird. Sometimes you get Archive and sometimes you get an Advanced button. What controls which one you get? It depends on whether there is anything interesting in the Advanced dialog. If the volume supports either compression or encryption (or both), then you will get an Advanced dialog with check boxes for Archive, Compress and Encrypt. On the other hand, if the volume supports neither compression nor encryption, then ...