Showing results for September 2010 - Page 2 of 4 - The Old New Thing

Sep 23, 2010
0
0

You must flush GDI operations when switching between direct access and GDI access, and direct access includes other parts of GDI

Raymond Chen
Raymond Chen

A customer was running into problems when accessing the pixels of a DIB section. They used the parameter to and created two bitmaps from the same underlying memory. Those two bitmaps were then selected into corresponding DCs, and the customer found that changes to the pixels performed by writing via one DC were not visible when read from the oth...

Code
Sep 22, 2010
0
0

Happy Mid-Autumn festival 2010

Raymond Chen
Raymond Chen

The other day, I told my niece that I would be eating a moon cake on Wednesday. She asked, "Why? Is it your birthday?" For the record, my favorite flavor is red bean paste. Bonus chatter: The underground economy of moon cakes, moon cake vouchers, and how moon cakes are like fruitcake.

Non-Computer
Sep 21, 2010
0
0

Fact check: The first major Microsoft product launched via Webcast

Raymond Chen
Raymond Chen

In 2009, while hosting the Webcast launch of Office Communications Server 2007 R2 (what a mouthful; no wonder they renamed it Lync), Stephen Elop claimed that this was the first time Microsoft had launched a major product via Webcast. Elop's crack team of marketing researchers apparently forgot about the Webcast launch, just three months earlie...

History
Sep 20, 2010
0
0

How do I get the dropped height of a combo box?

Raymond Chen
Raymond Chen

Via the Suggestion Box, commenter Twisted Combo responds to an old blog entry on why the size of a combo box includes the height of the drop-down by asking, But how do I *get* the dropped down height?" By using the deviously-named message, which the header file wraps inside the macro. Start with the scratch program and make these changes:...

Code
Sep 17, 2010
0
0

It's amazing how many business meetings there are in Munich in late September

Raymond Chen
Raymond Chen

During my emergency vacation, we stopped at a German supermarket, and my friend loaded up on all sorts of odd and fascinating products. This is something he does every time he travels abroad. At the register, my friend did the work of unloading the cart onto the conveyor belt while I went ahead to bag and to deal with any questions from the cashie...

Non-Computer
Sep 17, 2010
0
0

What's up with the strange treatment of quotation marks and backslashes by CommandLineToArgvW

Raymond Chen
Raymond Chen

The way the function treats quotation marks and backslashes has raised eyebrows at times. Let's look at the problem space, and then see what algorithm would work. Here are some sample command lines and what you presumably want them to be parsed as: In the first example, we want quotation marks to protect spaces. In the second example, we want ...

Code
Sep 16, 2010
0
0

How is the CommandLineToArgvW function intended to be used?

Raymond Chen
Raymond Chen

The function does some basic command line parsing. A customer reported that it was producing strange results when you passed an empty string as the first parameter: Well, okay, yeah, but huh? The first parameter to is supposed to be the value returned by . That's the command line, and that's what was designed to parse. If you pass somethin...

Code
Sep 15, 2010
0
0

Follow-up: The impact of overwhelmingly talented competitors on the rest of the field

Raymond Chen
Raymond Chen

A while back, I wrote on the impact of hardworking employees on their less diligent colleagues. Slate uncovered a study that demonstrated the reverse effect: How Tiger Woods makes everyone else on the course play worse. The magic ingredient is the incentive structure. If you have an incentive structure which rewards the best-performing person, a...

Non-Computer
Sep 15, 2010
0
0

How do I create a UNC to an IPv6 address?

Raymond Chen
Raymond Chen

Windows UNC notation permits you to use a raw IPv4 address in dotted notation as a server name: For example, will show you the shared resources on the computer whose IP address is 127.0.0.1. But what about IPv6 addresses? IPv6 notation contains colons, which tend to mess up file name parsing since a colon is not a valid character in a path compone...

Tips/Support