Wednesday, December 9, 2009

How to add .NET control to a Win32 window

using System.Runtime.InteropServices;

[DllImport("user32.dll")]
private static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);

Then when you want attach control on window call
SetParent(control.Handle, parentHWND);
control.BringToFront();

No comments: