[DllImport("coredll.dll")]
static extern IntPrt SetCapture(IntPtr hWnd);
Declare Function SetCapture Lib "coredll.dll" (TODO) As TODO
None.
None.
You can use SetCapture in conjunction with GetCapture 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