H
H2Os
Hi
I have a Time Picker control written in VB.NET which has been cobbled
together from various examples found all over the web. It uses P/Invoke to
call CreateWindowEx and stores the window handle so that it can use
SendMessage to communicate with the physical window and seems to works fine.
My question is this: At what point is the window destroyed and the handle
released? I have code in Dispose(Boolean) to call DestroyWindow, but it is
(apparently) never called (I have put some code to write out to a file and
it never happens).
Does the CLR handle destroying the window and if so is it when the control
is GC'd or when the app exits? Or, should I be doing it somewhere else and
the CLR is orphaning it?
Any thoughts or solid knowledge would be gratefully received!
I have a Time Picker control written in VB.NET which has been cobbled
together from various examples found all over the web. It uses P/Invoke to
call CreateWindowEx and stores the window handle so that it can use
SendMessage to communicate with the physical window and seems to works fine.
My question is this: At what point is the window destroyed and the handle
released? I have code in Dispose(Boolean) to call DestroyWindow, but it is
(apparently) never called (I have put some code to write out to a file and
it never happens).
Does the CLR handle destroying the window and if so is it when the control
is GC'd or when the app exits? Or, should I be doing it somewhere else and
the CLR is orphaning it?
Any thoughts or solid knowledge would be gratefully received!