Garbage Collector deleting Win32 window wrapped in NativeWindow Class
Hi
I have a class derived from NativeWindow which calls CreateHandle to create a WIN32 registered window.
However, the WIN32 window created suddenly gets destroyed and I've proved its the Garbage Collector thats doing it presumably because the derived NativeWindow Class gets destroyed. The NativeWindow Class is created in a UserControl derived class which in turn is hosted on a Windows Form.
I did post a link to the original post I made on the WIndows Forms forum which included sample code but a moderator deleted the post as a Cross Post but its not a WIndows Forms issue but a Garbage Collection one so I think this is the correct forum for it. I darent post the link again in case the post is deleted.
Why would the Garbage Collector destroy a NativeWIndow class and would there be a way to stop it doingso.

