时间:2021-01-08 12:21:39 | 栏目:.NET代码 | 点击:次
[DllImport("coredll.dll")]
private static extern IntPtr GetCapture();
public static IntPtr GetHWnd(Control ctrl)
{
IntPtr hOldWnd = GetCapture();
ctrl.Capture = true;
IntPtr hWnd = GetCapture();
ctrl.Capture = false;
SetCapture(hOldWnd);
return hWnd;
}
}