A
Arthur Freund
Hi,
for our application, we want to keep track on whether the user is
currently in a text box or not. So I simply retrieved the handle
of the focus window and tried System.Window.Forms.Control.FromHandle
to get the control that is responsible for this handle.
Now, this works fine. The next thing I did, was to cast as TextBoxBase
to get a clue on whether the control is a text box, which does work
also.
I also created a class that derives from NativeWindow, added an override
to the message procedure and handled the desired messages.
Now comes the strange effect:
I called Assign(handle) on this class and everything works fine. When I
call Release() on the class, the next time a call Control.FromHandle
returns null all the time.
Any ideas on this? I know, that there is a NativeWindow.FromHandle, but
that does not help me, since I need to filter some messages.
Any help will be appreciated.
Thanks in advance
Arthur
for our application, we want to keep track on whether the user is
currently in a text box or not. So I simply retrieved the handle
of the focus window and tried System.Window.Forms.Control.FromHandle
to get the control that is responsible for this handle.
Now, this works fine. The next thing I did, was to cast as TextBoxBase
to get a clue on whether the control is a text box, which does work
also.
I also created a class that derives from NativeWindow, added an override
to the message procedure and handled the desired messages.
Now comes the strange effect:
I called Assign(handle) on this class and everything works fine. When I
call Release() on the class, the next time a call Control.FromHandle
returns null all the time.
Any ideas on this? I know, that there is a NativeWindow.FromHandle, but
that does not help me, since I need to filter some messages.
Any help will be appreciated.
Thanks in advance
Arthur