Showing results for April 2013 - Page 3 of 3 - The Old New Thing

Apr 10, 2013
0
0

The problem with adding more examples and suggestions to the documentation is that eventually people will stop reading the documentation

Raymond Chen
Raymond Chen

I am a member of a peer-to-peer discussion group on an internal tool for programmers which we'll call Program Q. Every so often, somebody will get tripped up by smart quotes or en-dashes or ellipses, and they will get an error like C:\> q select table –s “awesome table” Usage: q select table [-n] [-s] table Error: ...

Other
Apr 9, 2013
0
0

On giving a name at the register to be called when your order is ready

Raymond Chen
Raymond Chen

Shultzy's Sausage describes itself as "Seattle's Wurst Restaurant since 1989!" It's a local hangout for sausage, beer, chili, and advanced dishes like sausage with beer or sausage with chili. In the early 1990's, Shultzy's expanded to a second location just a few blocks from Microsoft's main campus in Redmond, at a location known to my circle of...

Non-Computer
Apr 8, 2013
0
0

Another meaning of the word leptoceratops

Raymond Chen
Raymond Chen

I dreamed that a number of the form (10ⁿ−1)/9 was called a "leptoceratops." And it had to be tied up with a squid...

Non-ComputerDream
Apr 8, 2013
0
0

The managed way to retrieve text under the cursor (mouse pointer)

Raymond Chen
Raymond Chen

Today's Little Program is a managed version of the text-extraction program from several years ago. It turns out that it's pretty easy in managed code because the accessibility folks sat down and wrote a whole framework for you, known as UI Automation. (Some people are under the mistaken impression that UI Automation works only for extracting ...

Code
Apr 5, 2013
0
0

How do I wait until all processes in a job have exited?

Raymond Chen
Raymond Chen

A customer was having trouble with job objects, specifically, the customer found that a Wait­For­Single­Object on a job object was not completing even though all the processes in the job had exited. This is probably the most frustrating part of job objects: A job object does not become signaled when all processes have exited. The ...

Code
Apr 4, 2013
0
0

Don’t forget, the fourth parameter to ReadFile and WriteFile is sometimes mandatory

Raymond Chen
Raymond Chen

The Read­File and Write­File functions have a parameter called lp­Number­Of­Byte­Read, which is documented as __out_opt LPDWORD lpNumberOfBytesRead, // or __out_opt LPDWORD lpNumberOfBytesWritten, "Cool," you think. "That parameter is optional, and I can safely pass NULL." My program runs fine if standard output ...

Code
Apr 3, 2013
0
0

How can I move an HTREEITEM to a new parent?

Raymond Chen
Raymond Chen

Suppose you have a TreeView control, and you created an item in it, and you want to move the to a new parent. How do you do that? You can't, at least not all in one motion. You will have to delete the and then re-create it in its new location. If you want to move an within the same parent (say, to reorder it among its siblings), then you...

Code
Apr 2, 2013
0
0

Where did the research project RedShark get its name?

Raymond Chen
Raymond Chen

Project code names are not arrived at by teams of focus groups who carefully parse out every semantic and etymological nuance of the name they choose. (Though if you read the technology press, you'd believe otherwise, because it turns out that taking a code name apart syllable-by-syllable searching for meaning is a great way to fill column-inches...

History
Apr 1, 2013
0
0

The joke’s on you, because PATH goes to Penn Station, not Grand Central!

Raymond Chen
Raymond Chen

I dreamed that I was asked to develop a hill-avoiding bike route from my childhood home. Along the way, I rode through a daycare playroom (twice, due to a spiral path), met Madonna, the ghost of Alec Baldwin's wife, a team from The Amazing Race trying to figure out which PATH train goes to Grand Central (trick question!) and waited for the next ...

Non-ComputerDream