Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,105 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,704 people online right now. Registration is fast and FREE... Join Now!




mouse_event()

 
Reply to this topicStart new topic

mouse_event()

skyHigh
1 Oct, 2007 - 07:23 PM
Post #1

D.I.C Head
**

Joined: 1 Oct, 2007
Posts: 87


My Contributions
CODE


void main()
{
...
...
..
mouseClass mc;
mc.mouse_event(100,100);

}



void mouseClass::mouse_move(int xPosition, int yPosition)
{
    mouse_event(MOUSEEVENT_MOVE, xPosition, yPosition, 0, 0);

}


So far the function is working, but is there a way that I change the speed of the mouse so that I can actually see it's moving to the given position because right now all it does, the cursor will disappear then reappear at the given position thus I don't see it's moving. So what can I do if I want to actually see the mouse moving to that giving position? Also another question is that, if I run the same code in different monitor size, my position is way different from each other on the two screens. It seems the position is not corresponding to the current active window itself, so how can I fix that problem?

thanks in advance.

This post has been edited by skyHigh: 1 Oct, 2007 - 07:25 PM
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: Mouse_event()
2 Oct, 2007 - 10:08 PM
Post #2

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 3,906



Thanked: 34 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
QUOTE
but is there a way that I change the speed of the mouse so that I can actually see it's moving to the given position because right now all it does,


Yes there is, but there is no direct function. You'll have to use a Timer and move the cursor one coordinate at a time till it reaches the final point.
User is offlineProfile CardPM
+Quote Post

skyHigh
RE: Mouse_event()
3 Oct, 2007 - 08:37 AM
Post #3

D.I.C Head
**

Joined: 1 Oct, 2007
Posts: 87


My Contributions
QUOTE(born2c0de @ 2 Oct, 2007 - 11:08 PM) *

QUOTE
but is there a way that I change the speed of the mouse so that I can actually see it's moving to the given position because right now all it does,


Yes there is, but there is no direct function. You'll have to use a Timer and move the cursor one coordinate at a time till it reaches the final point.



thanks for your reply. If plotting points then it's going to be alot of points to plot..
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 09:15PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month