End Google Ads 201810 - BS.net 01 --> We have a managed C# DLL registered for COM interop. This DLL can be called from either a managed or unmanaged application where the customer can control the size and position of the DLL. In our demo application, we use the following win32 API functions to call the DLL. The problem we're running against is that we're losing mouse functions on toolstrip menu items after clicking in the form, even though the hot keys will still work using the keyboard. All controls work initially until clicking on the title bar (which I omitted) or certain controls on the main form.

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

[DllImport("user32.dll", SetLastError = true)]
public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);

[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
private void btnAdopt_Click(object sender, EventArgs e)
{
hWndDocked = (IntPtr)FindWindow(null, "DLL-Title";);
hWndOriginalParent = SetParent(hWndDocked, this.Handle);
MoveWindow(hWndDocked, 125, 25, iWidth, iHeight, true);
}

Some of the DLL dropdowns we can make work by changing the Parent Handle below in close event:
SetForegroundWindow(Global.ParentHandle);

Hopefully my explanation is clear, but has anyone run across this problem? Is there a better way of setting and controlling the DLL handles without losing certain mouse functionality? How can I make this work or what am I doing wrong?

Thanks in Advance,
Rick