Showing archive results for 2011

Aug 8, 2011
Post comments count0
Post likes count1

What does the CreateProcess function do if there is no space between the program name and the arguments?

Raymond Chen

In an old discussion of why the function modifies its command line, commenter Random832 asked, "What if there is no space between the program name and arguments - like "cmd/?" - where does it put the null then?" The function requires a space between the program name and arguments. If you leave out the space, then the arguments are considered ...

Code
Aug 5, 2011
Post comments count0
Post likes count1

Menu item states are not reliable until they are shown because they aren't needed until then

Raymond Chen

A question arrived from a customer (with the rather unhelpful subject line Question for Microsoft) wondering why, when they call and then ask for the states of the various menu items like , the menu item states don't reflect reality. The menu item states don't synchronize with reality until the user actually opens the system menu. There is no req...

CodeHistory
Aug 4, 2011
Post comments count0
Post likes count1

Why doesn't b match word boundaries correctly?

Raymond Chen

A colleague of mine was having trouble getting the metacharacter in a regular expression to work. Of course, when somebody asks a question like that, you first have to establish what their definition of "work" is. Fortunately, he provided some examples: "The last two entries are just sanity checks to make sure I didn't make some stupid mistake l...

Code
Aug 3, 2011
Post comments count0
Post likes count1

A shell extension is a guest in someone else's house; don't go changing the code page

Raymond Chen

A customer reported a problem with their shell extension: We want to format a floating point number according to the user's default locale. We do this by calling to convert the value from floating point to text with a period (U+002E) as the decimal separator, then using to apply the user's preferred grouping character, decimal separator, etc. W...

Code
Aug 2, 2011
Post comments count0
Post likes count1

An even easier way to get Windows Media Player to single-step a video

Raymond Chen

Since my original article explaining how to get Windows Media Player to single-step a video, I've learned that there's an even easier way. Backward-stepping is dependent upon the codec; some of them will go backward to the previous keyframe. The person who tipped me off to this feature: The developer who implemented it. Remember: Sharing a ti...

Tips/Support
Aug 2, 2011
Post comments count0
Post likes count3

Microspeak: Dogfood

Raymond Chen

The shifting meaning.

OtherMicrospeak
Aug 1, 2011
Post comments count0
Post likes count1

Why can you set each monitor to a different color depth?

Raymond Chen

Random832 seemed horrified by the fact that it is possible to run multiple monitors, with different color formats on each monitor. "Seriously, why does it let you do that?" Well, of course you can do that. Why shouldn't it let you do that? When multiple monitors were introduced to Windows, video hardware was nowhere near as advanced as it is toda...

Other
Jul 29, 2011
Post comments count0
Post likes count1

Hey, let's report errors only when nothing is at stake!

Raymond Chen

Only an idiot would have parameter validation, and only an idiot would not have it. In an attempt to resolve this paradox, commenter Gabe suggested, "When running for your QA department, it should crash immediately; when running for your customer, it should silently keep going." A similar opinion was expressed by commenter Koro and some others. ...

Other
Jul 28, 2011
Post comments count0
Post likes count1

Simulating input via WM_CHAR messages may fake out the recipient but it won't fake out the input system

Raymond Chen

We saw some time ago that you can't simulate keyboard input with . You may get away with it, depending on how the application you're trying to fake out processes input, but since you're just faking data, the application may discover that it's all a ruse when they try to access information that you didn't fake out, say by calling and discovering t...

Code
Jul 27, 2011
Post comments count0
Post likes count1

Luxurifying the camping experience in a different direction

Raymond Chen

Some time ago, I noted the increasing luxurification of camping, where people with more money than sense decide to go through the camping experience without building any of the character that comes with it. But that's not the only direction luxurification has moved. Unwilling to accept that "getting there is half the fun", some people take char...

Non-Computer