The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: georgek01 on April 19, 2011, 09:32:26 AM

Title: Deleting a Region
Post by: georgek01 on April 19, 2011, 09:32:26 AM
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
Title: Re: Deleting a Region
Post by: georgek01 on April 19, 2011, 09:56:25 AM
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.