Showing results for July 2012 - The Old New Thing

Jul 31, 2012
0
3

Reading the output of a command into a batch file variable

Raymond Chen
Raymond Chen

It's Day Two of Batch File Week. Don't worry, it'll be over in a few days. There is no obvious way to read the output of a command into a batch file variable. In unix-style shells, this is done via backquoting. The Windows command processor does not have direct backquoting, but you can fake it by abusing the command. Here's the evolution: ...

Code
Jul 30, 2012
0
0

Raymond's subjective, unfair, and completely wrong impressions of the opening ceremonies of a major athletic event which took place recently

Raymond Chen
Raymond Chen

Like many other people, I watched the opening ceremonies of a major athletic event which took place a few days ago. (The organization responsible for the event has taken the step of blocking the mention of the name of the city hosting the event and the year the event takes place, or the name of the event itself except in editorial news pieces or ...

Non-Computer
Jul 30, 2012
0
0

Why don't any commands work after I run my batch file? I'm told that they are not recognized as an internal or external command, operable program, or batch file.

Raymond Chen
Raymond Chen

I sort of forgot to celebrate CLR Week last year, so let's say that CLR week is "on hiatus" until next year. To fill the summertime time slot, I'm going to burn off a busted pilot: This week is Batch File Week 2012. Remember, nobody actually enjoys batch programming. It's just something you have to put up with in order to get something done. Batch...

Code
Jul 27, 2012
0
0

Psychic debugging: Why your IContextMenu::InvokeCommand never gets called

Raymond Chen
Raymond Chen

A customer reported a problem with their shell context menu extension. I have implemented the shell extension, but when the user selects my custom menu item, my is never called. Can anyone please let me know what the problem could be and how to fix it? Since there really isn't much information provided in this request, I was forced to invoke m...

Code
Jul 26, 2012
0
0

A brief and also incomplete history of Windows localization

Raymond Chen
Raymond Chen

The process by which Windows has been localized has changed over the years. Back in the days of 16-bit Windows, Windows was developed with a single target language: English. Just English. After Windows was complete and masters were sent off to the factory for duplication, the development team handed the source code over to the localization teams...

Other
Jul 24, 2012
0
0

Taking flexitarianism to another, perhaps unintended, level

Raymond Chen
Raymond Chen

Our cafeteria has been trying to encourage flexitarianism, which it defines as eating one meat-free meal per week. But in their effort to make the concept more appealing, they may have lost sight of the goal. (The "Vegetarian Option" magnet was probably intended for the Asparagus, Mushroom and Spinach Pizette just above it.) One of my colleagues...

Non-Computer
Jul 23, 2012
0
0

What's the story behind the WM_SYNCPAINT message?

Raymond Chen
Raymond Chen

Danail wants to know the story behind the message. The documentation pretty much tells the story. When a window has been hidden, shown, moved or sized, the system may determine that it needs to send a message to the windows of other threads. This message must be passed to , which will send the and messages to the window as necessary. When y...

Other
Jul 20, 2012
0
0

The format of icon resources

Raymond Chen
Raymond Chen

It's been a long time since my last entry in the continuing sporadic series on resources formats. Today we'll look at icons. Recall that an icon file consists of two parts, an icon directory (consisting of an icon directory header followed by a number of icon directory entries), and then the icon images themselves. When an icon is stored in r...

Other
Jul 19, 2012
0
0

Why do some font names begin with an at-sign?

Raymond Chen
Raymond Chen

It was a simple question. For some reason, my font selection dialog () shows a bunch of font names beginning with the at-sign (@). These fonts don't work correctly if I use them. Any idea what they are? (I tried searching the Internet, but search engines don't seem to let you search for so it's hard to make much headway.) (And that's why I...

Code