The joke's on you, because PATH goes to Penn Station, not Grand Central!
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...
View ArticleWhere did the research project RedShark get its name?
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...
View ArticleHow can I move an HTREEITEM to a new parent?
Suppose you have a TreeView control, and you created an item in it, and you want to move the HTREEITEM to a new parent. How do you do that? You can't, at least not all in one motion. You will have to...
View ArticleDon't forget, the fourth parameter to ReadFile and WriteFile is sometimes...
The ReadFile and WriteFile functions have a parameter called lpNumberOfByteRead, which is documented as __out_opt LPDWORD lpNumberOfBytesRead, // or __out_opt LPDWORD lpNumberOfBytesWritten,...
View ArticleHow do I wait until all processes in a job have exited?
A customer was having trouble with job objects, specifically, the customer found that a WaitForSingleObject on a job object was not completing even though all the processes in the job had exited....
View ArticleThe managed way to retrieve text under the cursor (mouse pointer)
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...
View ArticleAnother meaning of the word leptoceratops
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.
View ArticleOn giving a name at the register to be called when your order is ready
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...
View ArticleThe problem with adding more examples and suggestions to the documentation is...
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,...
View ArticleThe importance of having a review panel of twelve-year-old boys, episode 2
Microsofties love their acronyms, but you have to remember to send every potential name through a review panel of twelve-year-old boys to identify the lurking embarrassments. When it came time in...
View ArticleIs it legal to call have a cross-process parent/child or owner/owned window...
A customer liaison asked whether it was legal to use SetParent to create a parent/child relationship between windows which belong to different processes. "If I remember correctly, the documentation...
View ArticleThe phenomenon of houses with nobody living inside, for perhaps-unexpected...
In London, some of the most expensive real estate is in neighborhoods where relatively few people actually live. According to one company's estimate, 37% of the the residences have been purchased by...
View ArticleUsing opportunistic locks to get out of the way if somebody wants the file
Opportunistic locks allow you to be notified when somebody else tries to access a file you have open. This is usually done if you want to use a file provided nobody else wants it. For example, you...
View ArticleYour tenant and your lover, in your dreams
I dreamed that a friend of mind said, "Between your tenant and your lover, you should get along with at least one of them."
View ArticleDangerous setting is dangerous: This is why you shouldn't turn off write...
Okay, one more time about the Write-caching policy setting. This dialog box takes various forms depending on what version of Windows you are using. Windows XP: Enable write caching on the diskThis...
View ArticleIf you don't know what you're going to do with the answer to a question, then...
A customer asked the following question: We've found that on Windows XP, when we call the XYZ function with the Awesome flag, the function fails for no apparent reason. However, it works correctly on...
View ArticleHow can I figure out which user modified a file?
The GetFileTime function will tell you when a file was last modified, but it won't tell you who did it. Neither will FindFirstFile, GetFileAttributes, or ReadDirectoryChangesW, or...
View ArticleWhy does CoCreateInstance work even though my thread never called...
While developing tests, a developer observed erratic behavior with respect to CoCreateInstance: In my test, I call CoCreateInstance and it fails with CO_E_NOTINITIALIZED. Fair enough, because my...
View ArticleTechnically not lying, but not exactly admitting fault either
I observed a spill suspiciously close to a three-year-old's play table. I asked, "How did the floor get wet?" She replied, "Water." It's not lying, but it's definitely not telling the whole story....
View ArticleGetting the current selection from an Explorer window
Today's Little Program prints the current selection in all open Explorer windows. (This is an alternative to the C++ version that involves a ridiculous amount of typing.) var shellWindows = new...
View Article