I\'m trying to create a message-only window to receive window messages from an MFC library class, within a winforms application.
I\'ve tried subclassing NativeWind
NativeWind
Try that :
[DllImport("user32.dll")] static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); static IntPtr HWND_MESSAGE = new IntPtr(-3); protected override void OnHandleCreated(EventArgs e) { base.OnHandleCreated(e); SetParent(this.Handle, HWND_MESSAGE); }