The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
Low-level hooks have thread affinity, so make sure you keep an eye on the thread
Poof, it's gone.
Why don't you forward WM_GETMINMAXINFO and clamp the results?
In my illustration of how to make a window resizable in only one direction, commenter Josua asks, "Why don't you forward and clamp the results?" I'm going to assume the question is really "Why don't you forward before clamping the results?" rather than "Why did you bother writing all this code in the first place? Why not simply forward and clamp the results?"¹ The answer is that forwarding doesn't do anything. As noted in the documentation, the incoming structure already has the default values on entry. The default handler for the message returns without doing anything, since all the default handler...
How does Task Manager compute Up Time, and why doesn't it agree with GetTickCount?
Task Manager shows a piece of information called "Up time". How is this value calculated, and why doesn't it agree with the value reported by /? Task Manager calculates "up time" by subtracting the system boot time from the current time. In other words, it is misnamed; it really should be called time since system was started. It doesn't subtract out the time when the computer was in sleep or hibernation. The tick count, on the other hand, counts only time that elapses while the computer is on.
Can I run a service executable from a network location?
You can, but you shouldn't.
Documentation creates contract, which is why you need to be very careful what you document
Once it's documented, it needs to remain supported forever.
Hidden message in a T-shirt, it's been done before
While everybody is trying to figure out the hidden message in Joe Belfiore's T-shirt,¹ I figure I'd give you an easier puzzle. Here is the pattern of 0's and 1's printed on the T-shirt handed given out at the Windows 8 kick-off meeting. Because you don't have a project until you have a T-shirt. The actual shirt clipped many of the digits to make the shape come out smoother. I've filled in the partial digits. There are at least two typos in the shirt. It didn't take a room full of developers long to decode the message. Click here to reveal the answer. The digits are merely the binary encoding ...
Why is there an invisible U+202A at the start of my file name?
The desperation Left-to-right marker.
What does it mean when the Advanced Security Settings dialog says that an ACE was inherited from "Parent Object" without naming the specific parent?
The Advanced Security Settings dialog shows the ACEs in an object's ACL, and one of the pieces of information is a column labeled Inherited from which identifies whether the ACE was inherited, and if so, from where. A customer observed that when they opened the Advanced Security Settings dialog, one of their objects had an ACE that showed Parent Object as the Inherited from. However, when they went to the parent object , that ACE is nowhere to be found. How can an ACE be inherited from its parent, when it doesn't exist in the parent? The Advanced Security Settings dialog is trying to be helpful, but in...
Creating a window that can be resized in only one direction
Overriding WM_NCHITTEST.