By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,088 Members | 975 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,088 IT Pros & Developers. It's quick & easy.

Cleaning up NativeWindows

P: n/a
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?
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Mikey" <bo******@hotmail.com> wrote in message
news:62**************************@posting.google.c om...
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?

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.