Skip to content

Move mouse on PocketPC

Asked Mar 27, 2007, 5:10 AM EDT2 answers
Share
LinkedInX
Hi everybody, i want to move the mouse cursor on my Pocket PC with C#-code. Can anybody tell me how to do this? I´ve some code for Win32, but that doesn´t work with the compact framework. Please help!

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Mike Gold
    0
    Hi,

    The compact framework doesn't really have a cursor.  It uses the stylus.  Stylus events in CF are all captured in MouseDown, MouseMove, and MouseUp events.  I would suggest checking out this article on MSDN (creating a scribble app in CF).
    0
  • 0
    Seems that mouse_move is the right thing, but I need to simulate these events for WindowsCE. So that I can move the mouse on my Screen with my app. I´ve tried the code below, but that doesn´t work. [DllImport("coredll")] private static extern void mouse_event(MOUSEEVENTF dwFlags, int dx, int dy, int dwData, int dwExtraInfo); [Flags] private enum MOUSEEVENTF { MOVE = 0x1, /*mouse move */ LEFTDOWN = 0x2, /*left button down */ LEFTUP = 0x4, /*left button up */ RIGHTDOWN = 0x8, /*right button down */ RIGHTUP = 0x10, /*right button up */ MIDDLEDOWN = 0x20, /*middle button down */ MIDDLEUP = 0x40, /*middle button up */ WHEEL = 0x800, /*wheel button rolled */ VIRTUALDESK = 0x4000, /*map to entrire virtual desktop */ ABSOLUTE = 0x8000, /*absolute move */ TOUCH = 0x100000, /* absolute move */ } private static void moveMouse(int x, int y) { mouse_event(MOUSEEVENTF.MOVE,x,y,0,0); }
    0