The Old New Thing

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

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 ...

Happy Mid-Autumn festival 2010

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...

Fact check: The first major Microsoft product launched via Webcast

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 ...

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

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 ...

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

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 ...

How is the CommandLineToArgvW function intended to be used?

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 ...

How do I create a UNC to an IPv6 address?

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 ...