R
Richard Dutrulle
Hello,
This code product an exception (NotSupportedException) at WindowFromPoint
fonction on Emulator CF (Pocket PC).
IntPtr Handle(Control control)
{
IntPtr hdl = (IntPtr) 0;
Point p = new Point();
Point pp = new Point();
p.X = control.Left;
p.Y = control.Top;
Win32.Point ppp = new Win32.Point();
pp = control.PointToScreen(p);
ppp.x = pp.X + 1;
ppp.y = pp.Y + 1;
hdl = Win32.WindowFromPoint(ppp);
return hdl;
}
public struct Point {
public Int32 x, y;
#if false
public Point(int p1, int p2)
{
x = p1;
y = p2;
}
#endif
}
#if(Win32)
[DllImport("User32", EntryPoint="WindowFromPoint")]
#else
[DllImport("CoreDll", EntryPoint="WindowFromPoint")]
#endif
public static extern IntPtr WindowFromPoint(Point p);
This code product an exception (NotSupportedException) at WindowFromPoint
fonction on Emulator CF (Pocket PC).
IntPtr Handle(Control control)
{
IntPtr hdl = (IntPtr) 0;
Point p = new Point();
Point pp = new Point();
p.X = control.Left;
p.Y = control.Top;
Win32.Point ppp = new Win32.Point();
pp = control.PointToScreen(p);
ppp.x = pp.X + 1;
ppp.y = pp.Y + 1;
hdl = Win32.WindowFromPoint(ppp);
return hdl;
}
public struct Point {
public Int32 x, y;
#if false
public Point(int p1, int p2)
{
x = p1;
y = p2;
}
#endif
}
#if(Win32)
[DllImport("User32", EntryPoint="WindowFromPoint")]
#else
[DllImport("CoreDll", EntryPoint="WindowFromPoint")]
#endif
public static extern IntPtr WindowFromPoint(Point p);