The Old New Thing

What is the DC brush good for?

The DC brush is a stock brush associated with the device context. Like the system color brushes, the color of the DC brush changes dynamically, but whereas the system color brushes change color based on the system colors, the color of the DC brush changes at your command. The DC brush is handy when you need a solid color brush for a very...

When people ask for security holes as features: Hiding files from Explorer

By default, Explorer does not show files that have the flag, since somebody went out of their way to hide those files from view. You can, of course, ask that such files be shown anyway by going to Folder Options and selecting "Show hidden files and folders". This shows files and folders even if they are marked as . On the other hand, files ...

Project update: Voyage to Our Hollow Earth

In December 2003, I reported on Steve Currey's expedition to the hole at the top of the earth, which at the time was scheduled for June 26, 2005. But on May 6, 2004, the site rescheduled the trip for Jun 26, 2006 with no explanation. The reservation form reminds you that the 25% deposit is non-refundable. Far be it from me to suggest that...

What is the HINSTANCE passed to CreateWindow and RegisterClass used for?

One of the less-understood parameters to the function and the function is the (either passed as a parameter or as part of the structure). The window class name is not sufficient to identify the class uniquely. Each process has its own window class list, and each entry in the window class list consists of an instance handle and a ...

News flash: Everybody has to pay income tax

NFL rookies are required to attend "How not to mess up your life like those other professional athletes" training. They learn about such things as sexual harassment, AIDS, common-law marriage, and, of course, taxes. Kendrell Bell, a Pittsburgh Steelers linebacker, tells of his great awakening to the verities of income tax: "I got a million-...

Tweaking our computation of the interval between two moments in time

We can take our computation of the interval between two moments in time and combine it with the trick we developed for using the powers of mathematics to simplify multi-level comparisons to reduce the amount of work we impose upon the time/date engine. Observe that we avoided a call to the method (which is presumably rather complicated ...

Computing the interval between two moments in time

Computing the interval between two moments in time is easy: It's just subtraction, but subtraction may not be what you want. If you are displaying time units on the order of months and years, then you run into the problem that a month is of variable length. some people just take the value relative to a base date of January 1 and extract ...

Using the powers of mathematics to simplify multi-level comparisons

What a boring title. Often you'll find yourself needing to perform a multi-level comparison. The most common example of this is performing a version check when there are major and minor version numbers involved. Bad version number checks are one of the most common sources of errors. If you're comparing version numbers, you can use the ...

There's an awful lot of overclocking out there

A bunch of us were going through some Windows crashes that people sent in by clicking the "Send Error Report" button in the crash dialog. And there were huge numbers of them that made no sense whatsoever. For example, there would be code sequences like this: Yet when we looked at the error report, the and registers were equal! There were...