Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

A question about cleaning up after REGIONS ..

0 views
Skip to first unread message

Taco Bill

unread,
Jun 6, 1999, 3:00:00 AM6/6/99
to
Should I be doing anythign extravagent when cleaning up after using a region
.. at present when I use them . I define them and when closign down I
DeleteObject(MyRgn); ... is there anything else one should be doing ?

--
-
+===========================+
| Taco Bill thanks you for your
| kind help ..sorry you can't mail
| me ... thank the spammers
+============+

Chris Marriott

unread,
Jun 6, 1999, 3:00:00 AM6/6/99
to

Taco Bill wrote in message ...

>Should I be doing anythign extravagent when cleaning up after using a
region
>.. at present when I use them . I define them and when closign down I
>DeleteObject(MyRgn); ... is there anything else one should be doing ?


No, that's all you need do, other than the obvious "caveat" of making sure
that it's not selected into any DC at the time you destroy it. A region is a
GDI object like any other.

Chris
-----------------------------------------------------------------------
Chris Marriott, SkyMap Software, UK (ch...@skymap.com)
Visit our web site at http://www.skymap.com
Astronomy software written by astronomers, for astronomers

Raymond Chen

unread,
Jun 7, 1999, 3:00:00 AM6/7/99
to
And don't forget that once you call SetWindowRgn, the region is
no longer yours and you should *not* call DeleteObject on it.
--
(My return address is intentionally invalid; delete ".---" to get my real address.
My responses are not to be considered official technical support or advice.)

Taco Bill

unread,
Jun 7, 1999, 3:00:00 AM6/7/99
to
This is where I am get confused ... I read in the SDK that the region is no
longer mine .. so you are saying that after I am about to exit my windows
program I should NOT DeleteObject(MyRegionHandle); ...

so it does not just chew up memory if I do this ? hmmm getting confused
again ..

Raymond Chen <raymon...@microsoft.com> wrote in message
news:375b30b4....@news.alt.net...

Chris Marriott

unread,
Jun 7, 1999, 3:00:00 AM6/7/99
to

Raymond Chen wrote in message <375b30b4....@news.alt.net>...

>And don't forget that once you call SetWindowRgn, the region is
>no longer yours and you should *not* call DeleteObject on it.


True, but the original questioner didn't mention "SetWindowRgn"!

Raymond Chen

unread,
Jun 8, 1999, 3:00:00 AM6/8/99
to
On Mon, 7 Jun 1999 13:26:46 +1000, "Taco Bill"
<nos...@nospam.com.au> wrote:
>This is where I am get confused ... I read in the SDK that the region is no
>longer mine .. so you are saying that after I am about to exit my windows
>program I should NOT DeleteObject(MyRegionHandle); ...
>
>so it does not just chew up memory if I do this ? hmmm getting confused
>again ..

Once you call SetWindowRgn the region belongs to Windows.
Windows will delete the region object when the system no longer
needs it.

0 new messages