How to find HWIND of Windows from Handle in C#?

Dear Experts

I need to find a HWND for Windows Form (NET Framework 2.0)   from this.Handle. How to do it ? More, I need to get in variable in IWin32Window . I need this because of use third part components and I need to pass it.
To be more clear,  I do not want to use find procedure via title of Windows, I believe there other way.

Who is Participating?
Miguel OzConnect With a Mentor Software EngineerCommented:
If your third part components are .net, then you can pass the the form instance itself.
For example I use the following construct a lot:
where parentForm is a valid from instance. Form supports IWin32Window interface.
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
"this.Handle" is the HWND but in IntPtr form...

You can simply convert it to an int if that is what you are looking for:

    int HWND = this.Handle.ToInt32();

I suspect there's more to it than this though!

Can you explain in MORE DETAIL please?...
Jaime OlivaresConnect With a Mentor Software ArchitectCommented:
it is as easy as:

IWin32Window hwnd = yourform.Handle;
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.