handle of a combobox?

  • Thread starter Thread starter Dante
  • Start date Start date
D

Dante

Is there any way to get the handle of a combobox control?
I know the .handle method for combobox is not supported in
the .net compact framework, but maybe there is another way
to get to it?
 
If it has a Capture property, you can set that to TRUE, then P/Invoke the
API function GetCapture() (which returns the window handle), then set
Capture back to FALSE. Something like this:

IntPtr h = System.IntPtr.Zero;
x.Capture = true;
h = GetCapture();
x.Capture = false;

This declaration for GetCapture() seems to work for me:

[DllImport("coredll.dll")]
internal extern static IntPtr GetCapture();

Paul T.
 
Thanks! that worked great!

-----Original Message-----
If it has a Capture property, you can set that to TRUE, then P/Invoke the
API function GetCapture() (which returns the window handle), then set
Capture back to FALSE. Something like this:

IntPtr h = System.IntPtr.Zero;
x.Capture = true;
h = GetCapture();
x.Capture = false;

This declaration for GetCapture() seems to work for me:

[DllImport("coredll.dll")]
internal extern static IntPtr GetCapture();

Paul T.

Dante said:
Is there any way to get the handle of a combobox control?
I know the .handle method for combobox is not supported in
the .net compact framework, but maybe there is another way
to get to it?


.
 
Back
Top