@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm @cemsdn=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcesdkr/html/wcesdkr$$$.asp Summary: Retrieve a handle to the window that has captured mouse/stylus input. !!!!C# Signature: [DllImport("coredll.dll")] static extern IntPtr GetCapture(); !!!!VB .NET Signature: Declare Function GetCapture Lib "coredll.dll" () As IntPtr !!!!User-Defined Types: None. !!!!Notes: None. !!!!Tips & Tricks: You can use ""GetCapture"" in conjunction with ""SetCapture"" to obtain the window handle of a Control. See the sample code below. !!!!Sample Code: public IntPtr GetHWnd(Control ctrl) { IntPtr hOldWnd = GetCapture(); ctrl.Capture = true; IntPtr hWnd = GetCapture(); ctrl.Capture = false; SetCapture(hOldWnd); return hWnd; } !!!!This is a way of getting a 'dialog' window on PocketPC { private const int RequiredWidth = 200; private const int RequiredHeight = 148; private void Form_Load(object sender, System.EventArgs e) { this.Capture = true; IntPtr hWnd = GetCapture(); SetWindowPos(hWnd, hWnd, (Screen.PrimaryScreen.Bounds.Width-RequiredWidth)/2, 30, RequiredWidth, RequiredHeight, 0); } [DllImport("coredll.dll")] static extern IntPtr GetCapture(); [DllImport("coredll.dll")] static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); } !!!!Alternative Managed API: None Documentation: GetCapture@cemsdn on MSDN
Edit coredll.GetCapture
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.