[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 171
  • Last Modified:

how can i control the mouse

I program using vc++5.0 for education software.I want to know how can I control the mouse in a program,such as move the mouse automaticly,change the mouse style.
0
zhangfeng76
Asked:
zhangfeng76
  • 2
1 Solution
 
Vinayak KumbarSr Program ManagerCommented:
Hi,

U can move the cursor to specific location using
SetCursorPos(int x, int y);
      
And To set the cursor

HCURSOR hc = ::LoadCursor(0, IDC_WAIT );
SetCursor(hc);

Hope this helps.
VinExpert
0
 
Vinayak KumbarSr Program ManagerCommented:
Hi,

The code will look like
To set the position of mouse cursor to 10,10
SetCursorPos(10,10);

Then to change the style
this->SetCapture();
HCURSOR hc = ::LoadCursor(0, IDC_APPSTARTING );
SetCursor(hc);

Remember to call ReleaseCapture() also.

Try it out.
VinExpert
0
 
zhangfeng76Author Commented:
VinExpert;
  Thanks.
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now