Cleaning up NativeWindows

  • Thread starter Thread starter Mikey
  • Start date Start date
M

Mikey

Do NativeWindows get destroyed when the app shuts down?

While my app is running I can Spy++ and see my NativeWindow handle.
After app shutdown it's no longer there.

But this is confusing because if I Spy++ on the messages, and do a
DestroyHandle, I see a WM_DESTROY, but do not see this message when
the app shuts down. I presume the window has indeed been destroyed,
because Spy++ doesn't pick it up.

Should I be calling DestroyHandle, or is the framework cleaning up the
NativeWindow for me?
 
Mikey,

The framework is cleaning it up for you when it exits. When it exists,
the GC will cause classes that haven't been finalized to be finalized. If
the controls did not have Dispose called on them (releasing the windows
handle), it will be taken care of here.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top