Control.FromChildHandle Method - MSDN entry[
^]
According to the documentation
Control.FromChildHandle
walks
up the parent chain and returns the control with the given handle, null if not found.
I am trying to get the handle of a control in another application
you have to look into
EnumWindows[
^]
FindWindow[
^]
FindWindowEx[
^]
Or
UIAutomation[
^]
In short you won't be able to get a
Form
and any kind of
Control
object which represents a form/control in another application. Thus
Control.FromChildHandle
returns null when you give it a handle that doesn't belong to the current application.