mouse_event for mouse move is not working properly. 
Author Message
 mouse_event for mouse move is not working properly.

Hi,

I want to move the mouse to a specified position (screen co-ordinate).
I'm using Interop for this. I'm pasting my code below.

[DllImport("user32.dll")]
static extern void mouse_event(int dwFlags, int dx, int dy, int dwData,
int dwExtraInfo);

and calling it as

mouse_event(32769, Pos.X, Pos.Y, 0, GetMessageExtraInfo());

Pos is a point structure.

32769 value is equal to MOUSEEVENTF_ABSOLUTE|MOUSEEVENTF_MOVE since i
don't want a relative movement of mouse.

When is call this method, Mouse moves to a location which is close to
the point(x,y), but not to exact specififed position.

Is i'm missing something.

Thanks,
Abhijit

*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!



Fri, 04 Mar 2005 15:05:56 GMT  
 mouse_event for mouse move is not working properly.
Abhijit,

    You might want to consider using SendInput here instead of mouse_event,
as it might process it better and give you the results that you want.

    Hope this helps.

--
               - Nicholas Paldino [.NET/C# MVP]


Quote:
> Hi,

> I want to move the mouse to a specified position (screen co-ordinate).
> I'm using Interop for this. I'm pasting my code below.

> [DllImport("user32.dll")]
> static extern void mouse_event(int dwFlags, int dx, int dy, int dwData,
> int dwExtraInfo);

> and calling it as

> mouse_event(32769, Pos.X, Pos.Y, 0, GetMessageExtraInfo());

> Pos is a point structure.

> 32769 value is equal to MOUSEEVENTF_ABSOLUTE|MOUSEEVENTF_MOVE since i
> don't want a relative movement of mouse.

> When is call this method, Mouse moves to a location which is close to
> the point(x,y), but not to exact specififed position.

> Is i'm missing something.

> Thanks,
> Abhijit

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Fri, 04 Mar 2005 23:35:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. CFile not working properly, can't figure out why (last message not sent properly)

2. VC5, NT4 - mouse_event does not work

3. VC5, NT4 - mouse_event does not work

4. Tab key to tab between controls does not work properly

5. Scroll bars not working properly

6. AtlReportError not working in ATL 7.0 (Injected code doesn't handle ErrorInfo properly)

7. Links not working properly in the Object Browser

8. gets() and fgets() Not Working Properly - Source Included

9. Tab not working properly in control

10. Auto Complete feature does not work properly in Visual C++ 6.0

11. Auto Completion does not work properly!!!

12. Profiller not working properly

 

 
Powered by phpBB® Forum Software