Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi all

Please help me

I am trying to call the Windows API function "GetVCursorPos" from the PDA emulator that comes with .NET

I did the dll import and imported the appropriate libraries but i receive the following error:

"Method NotFound Exception"

Please help me

Thanks in advance

Life is the biggest school
Posted

I don't know if this will help at all, it depends what your trying to achieve. But the Control.PointToScreen() function will turn an application based point into a point relative to the screen.

	private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
	{
		Point pScreenRel = this.PointToScreen(new Point(e.X, e.Y));
	}

Anybody looking for a graduate programmer (Midlands, England)?
Posted
After doing some research all results points to the fact that GetCursorPosition() only works on devices that actually have a visible cursor. Since a PDA works through a touchscreen and thus has no onscreen cursor, the method does not work correctly.
Anybody looking for a graduate programmer (Midlands, England)?
Posted

On further research theres another method that might work in the coredll.dll called GetMouseMovePoints().

 

	[DllImport("coredll.dll")]

	public static extern bool GetMouseMovePoints( Point[] pptBuf, uint
		nBufPoints, ref uint pnPointsRetrieved );

This is used something like the following (note its not fully tested, but it does seem to return the value).

 

	private Point CursorLocation()
	{
		Point[] defPnt = new Point[1];
		uint iRetrieved = 0;
		uint iSize = (uint)defPnt.Length;
		GetMouseMovePoints(defPnt, iSize, ref iRetrieved);

		return defPnt[0];
	}

Anybody looking for a graduate programmer (Midlands, England)?
Posted

Thanks a lot.

What a bad luck.Look what I found on MSDN documentation for the function

GetMouseMovePoints()

This function is not supported for emulation.

I am very sad.

Life is the biggest school
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...