Raymond's subjective, biased, unfair, and completely wrong characterization...
Hokkien: This is the language I learned first, so to me it sounds perfectly normal and is in fact how languages should sound. I find it odd that people describe it as one of the more difficult...
View ArticleHow can I tell that I have a shell folder that represents My Computer?
You have in your hands an IShellFolder, and you want to know whether this is an IShellFolder that represents My Computer. There are a few ideas that may occur to you. One is to ask the folder for...
View ArticleProviding a custom autocomplete source for an edit control
Today's Little Program shows a custom source for autocomplete. It's nothing exciting, but at least's it's something you can use as a starting point for your own customizations. We start with a dialog...
View ArticleI dreamed that I was in an alternate-universe Samuel L. Jackson movie
I dreamed that I was part of the crew of an underwater spaceship, and we had to deal with an alligator that got on board. How the alligator got on board was never explained, but now is not the time to...
View ArticleWait, so does moving a file recalculate inherited permissions or doesn't it?
A customer had a question about whether moving a file recalculated inherited permissions. They found that on their Windows Server 2008 R2 machine, if they moved a file between directories with...
View ArticlePunctuation is becoming increasingly decorative and less functional
The "Blog" of "Unnecessary" Quotation Marks calls out abuse of the quotation mark. For some reason, quotation marks are being increasingly used as a form of emphasis (a usage which remains...
View ArticleHow can I tell that somebody used the MAKEINTRESOURCE macro to smuggle an...
Many functions and interfaces provide the option of passing either a string or an integer. The parameter is formally declared as a string, and if you want to pass an integer, you smuggle the integer...
View ArticleDon't forget, Unicode includes formatting characters which can be used to...
Consider this simple function: void Reminder(HWND hwnd) { MessageBoxW(nullptr, L"Please print out this form in triplicate " L"and bring it to the assistance desk " L"on level 2.", L"Reminder", MB_OK);...
View ArticleHow can I determine how responsive my application is to input?
A customer was adding diagnostics to their application and wanted to know if there was a way to detect that the application was being slow in processing its input. These sorts of delays manifest...
View Article2013 Q3 link clearance: Microsoft blogger edition
It's that time again: Linking to other Microsoft bloggers, and once again, the links are all from the excellent NT Debugging blog. Challenges of debugging optimized x64 code: A debugging walkthrough,...
View ArticleThe case of the redirected standard handles that won't close even though the...
A customer had a supervisor process whose job is to launch two threads. Each thread in turn launches a child process, let's call them A and B, each with redirected standard handles. They spins up...
View ArticleOpening and manipulating Internet Explorer windows programmatically
Today's Little Program takes the JavaScript application from a few years ago and converts it to C#. This was inspired by a customer who started with the question, "How can I close all Internet...
View ArticleUsing a toy cash register as a keyboard doesn't add up
I dreamed that I was composing a blog entry about one of my dreams, but I had to do it on a toy cash register which had been paired to my computer. It turns out that this is difficult for a number of...
View ArticleThe hierarchy of user education, as interpreted by a vice president
One of my colleagues told me a story from his days on the Windows team. He had to give a presentation to his vice president on his feature, and he prepared his presentation and demo obsessively to...
View ArticleIt rather involved being on the other side of this airtight hatchway:...
A bunch of security vulnerability reports came in from the same person, all of the form, "Program X is vulnerable to DLL planting if you create a DLL with the name Y in a directory on the PATH," with...
View ArticleWhen should I use the FIND_FIRST_EX_LARGE_FETCH flag to FindFirstFileEx?
Windows 7 introduces a new flag to the FindFirstFileEx function called FIND_FIRST_EX_LARGE_FETCH. The documentation says that it "uses a larger buffer for directory queries, which can increase...
View ArticleMy, those threads start up really fast nowadays
Here's a little puzzle inspired by an actual bug: // global variable DWORD g_WorkerThreadId; bool IsRunningOnWorkerThread() { return GetCurrentThreadId() == g_WorkerThreadId; } bool...
View ArticleUsing GetLogicalProcessorInformationEx to see the relationship between...
Today's Little Program uses the GetLogicalProcessorInformationEx function to print the mapping of logical processors to physical processors, as well as the mapping of logical processors to...
View ArticleThe financial acumen of sea turtles
I dreamed that I was attending some sort of "how to be awesome" seminar where the presenter said, among other things, that a sea turtle, when left to thrive undisturbed, amasses $1 million in personal...
View ArticleHelp me optimize this code which enumerates all possible GUIDs
Hi, I'm looking for help optimizing this code. It creates a file containing every possible GUID.class Program { public static void Main(string[] args) { using (var w = new...
View Article