[DllImport("coredll.dll")]
static extern IntPtr GetCapture();
Declare Function GetCapture Lib "coredll.dll" (TODO) As TODO
None.
None.
You can use GetCapture in conjunction with SetCapture to obtain the window handle of a Control. See the sample code below.
public IntPtr GetHWnd(Control ctrl)
{
IntPtr hOldWnd = GetCapture();
ctrl.Capture = true;
IntPtr hWnd = GetCapture();
ctrl.Capture = false;
SetCapture(hOldWnd);
return hWnd;
}
None