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 implementa better version of WM_SET­REDRAW.Our first version doesn't useWM_SET­REDRAW at all.Start with thescratch programand 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 itemby ...
Comments are closed.0 0
Code

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 Destroy­Window function will not destroywindows that belong to another thread,much less another process.The best you can do is post aWM_CLOSE message to the window to ask it nicely.The Def­Window­Proc function response to theWM_CLOSE message by destroying the...
Comments are closed.0 0
Code

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 afterI posted this story,the security team received something very similar.If have found that if you call theXYZ function(whose last parameter is supposed to be a pointer to a DWORD)and instead of passing a value pointer to a DWORD,you pass NULL,then you can trigger an access violation in the XYZ function.The XYZ ...

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 ...