Hi there,
I'm adding a few Regions (CreateEllipticRgn) in response to WM_PAINT messages. To do hit testing on the Regions later, I do not delete the Region handles (I store them in an array).
- when my form is resized quickly or if a fair amount of Regions are added, all painted Regions are removed from the form and no more painting takes place.
- if I however delete the Region handles after each paint operation, the problem does not occur, but then I can't do hit testing on the Regions.
My question is, how do I free up the Region resources but still do hit testing on them?
I've added a small app (adapted from Iczelion's PAINT tutorial) to demonstrate the hit test conundrum.
Regards,
George
I may have found a solution...
I'm deleting all the Region handles from the array before re-painting. That seems to free up the resources and I'm able to do hit testing on the newly created Regions in the array.