The Old New Thing

Using WM_SETREDRAW to speed up adding a lot of elements to a control

Today's Little Program shows one way you can implement a better version of . Our first version doesn't use at all. Start with the scratch program and make the following changes: Most of this program was stolen from my scroll bar series. The interesting new bits are that you can add one new item by hitting 1, or you can add ten thousand...

It's bad enough for a guest to demolish the host's house; demolishing an unrelated person's house is taking it to a whole new level

"How do I destroy a window that belongs to another process?" The function will not destroy windows that belong to another thread, much less another process. The best you can do is post a message to the window to ask it nicely. The function response to the message by destroying the window, but the window is free to add a custom handler ...

Why does the access violation error message put the operation in quotation marks? Is is some sort of euphemism?

When an application crashes with an access violation, the error message says something like The instruction at "XX" referenced memory at "YY". The memory could not be "read". Why is the operation in quotation marks? Is this some sort of euphemism? The odd phrasing is a consequence of globalization. The operation name is a verb in the ...

It rather involved being on the other side of this airtight hatchway: Invalid parameters from one security level crashing code at the same security level (again)

A few years after I posted this story, the security team received something very similar. If have found that if you call the XYZ function (whose last parameter is supposed to be a pointer to a ) and instead of passing a value pointer to a , you pass , then you can trigger an access violation in the XYZ function. The XYZ function does not ...

Buggy milk cartons, beeping computers, and other silliness

Some time ago, there was a performance-related bug that went something like this: mm/dd/yy Created by bob The attached file contains a dataset that takes a very long time to process. The engineer who fixed the problem decided to take the cryptic approach: mm/dd/yy Resolved as fixed by alice It got better. It was a common practice ...