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