If you have multiple versions of Windows installed, why do they all try to...
Commenter Martin notes that if you have multiple copies of Windows installed on your machine, then each one will try to adjust the clock when you enter or exit daylight saving time. "I cannot believe...
View ArticleMicrospeak: Friction
In physics, friction is a force that resists motion. In Microspeak, friction is an obstacle which prevents somebody from doing something you want them to do. (The preferred verb phrase for getting...
View ArticleHow do I get mouse messages faster than WM_MOUSEMOVE?
We saw some time ago that the rate at which you receive WM_MOUSEMOVE messages is entirely up to how fast your program calls GetMessage. But what if your program is calling GetMessage as fast as it...
View ArticleWhy does the VerQueryValue function give me the wrong file version number?
A customer was writing a test to verify that their patching system was working properly, but they found that even after the patch was installed, a call to VerQueryValue reported that the file was...
View ArticleMemory allocation functions can give you more memory than you ask for, and...
Memory allocation functions like HeapAlloc, GlobalAlloc, LocalAlloc, and CoTaskMemAlloc all have the property that they can return more memory than you requested. For example, if you ask for 13...
View ArticleWhy does holding the Ctrl key when selecting New Task from Task Manager open...
Commenter Adam S wonders why holding the Ctrl key when selecting New Task from Task Manager will open a command prompt. It's a rogue feature. Windows XP introduced visual styles, and one of the tricky...
View ArticleThe most exciting part of my morning is catching my bus, specifically, making...
Note: Transit nerd content. You have been warned. I still rely on One Bus Away to tell me when my bus is coming. Recent changes in bus service means that there is no longer a direct bus from my...
View ArticleIn 1993, Microsoft stole my colleague's car
I remember walking between buildings at Microsoft back in the 1990's and seeing a moss-covered, rusted-out jalopy in one of the parking spaces. It clearly hadn't moved in ages. The person I was with...
View ArticleIsn't there a race condition in GetFileVersionInfoSize?
In response to my explanation of what the lpdwHandle parameter in GetFileVersionInfoSize is used for, Steve Nuchia wonders if there's a race condition between the time you get the size and the...
View ArticleWhy does my window style change when I call SetWindowText?
A customer observed some strange behavior with window styles: We ran some weird behavior: Calling the SetWindowText function causes a change in window styles. Specifically, calling SetWindowText...
View ArticleWhy is the Heap32Next function incredibly slow on Windows 7?
A customer observed that the Heap32Function runs much slower on Windows 7 compared to previous versions of Windows. What happened? Set the wayback machine to 1992. The product is Windows 3.1. One of...
View ArticleBeverage Gas Division of Central Welding Supply
The other day, I saw a van which was labeled Beverage Gas Division of Central Welding Supply. This odd juxtaposition was created by the acquisition of Compressed Gas Western by Central Welding Supply...
View ArticleWhy does a maximized window have the wrong window rectangle?
Commenter configurator wonders why the maximum size for a form is the screen size plus (12,12). Somebody else wonders why it's the screen size plus (16,16). Let's start by rewinding the clock to...
View ArticleAmusing message on a whiteboard in the hallway
It is common to see whiteboards mounted in hallways. Sometimes they have official purposes; other times they are just placed for the convenience of hallway conversations or impromptu meetings. One of...
View ArticleConverting to Unicode usually involves, you know, some sort of conversion
A colleague was investigating a problem with a third party application and found an unusual window class name: L"整瑳整瑳". He remarked, "This looks quite odd and could be some problem with the...
View ArticleWhy can't I delete a file immediately after terminating the process that has...
A customer discovered a bug where terminating a process did not close the handles that the process had open, resulting in their emergency cleanup code not working: TerminateProcess(processHandle,...
View ArticleHow do I perform shell file operations while avoiding shell copy hooks?
Okay, the subject line of the article gives away the answer to the puzzle, but here's the puzzle anyway: A customer reported a problem with the SHFileOperation function: Consider the following...
View ArticleIf posting here is frequently frustrating and irritating, why do I keep doing...
Appreciator wonders, if I find posting here frequently frustrating and irritating, why I keep doing it anyway? Imagine I announced one day, "This is too frustrating and annoying. I'm going to stop...
View ArticleIntroducing the unrolled-switch anti-pattern
Over the years, I've seen a bunch of coding anti-patterns. I figured maybe I'll share a few. Today, I'll introduce what I'm calling the unrolled-switch anti-pattern, also known as "Specialization is...
View ArticleI totally presented to an executive the wrong way
Some time ago, Gray Knowlton wrote an article on how to present to an executive. As you might have guessed, I've done it completely the wrong way. Many years ago, I was part of a group presenting to a...
View Article