Get a windows object from its handle

How do I get a windows object from its handle in C#

IntPtr pointer = MyControl.Handle // this is fine

but how do I ....

Control c = GetControlFromIntPtr(IntPtr).



Answer this question

Get a windows object from its handle

  • pshaw

    With all the different classes, methods, and properties; sometimes it's quicker to ask :-)

  • imshally81

    Control.FromHandle()

  • mdanshin

    Thank you. I had trudged through MSDN, this forum and Google with no luck. I even missed in Intellisense cus I had declared an instance.
  • Get a windows object from its handle