| | |
MouseMove in Visual C++
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
Hey guys,
We're trying to work with a driver program for our robot. If we can grab the x and y coordinates of the Mouse we could send them to the controller for driving. Does anyone know how to capture the mouse movement into an integer?
We're trying to work with a driver program for our robot. If we can grab the x and y coordinates of the Mouse we could send them to the controller for driving. Does anyone know how to capture the mouse movement into an integer?
It is practically impossible to teach good programming style to students that have had prior exposure to Basic; as potential programmers they are mentally mutilated beyond hope of regeneration.
-Edsger Dijkstra
-Edsger Dijkstra
maybe:
http://www.daniweb.com/forums/thread67435.html
my output
I don't know about visual c++ but the above seems to work in dev-cpp I think.
http://www.daniweb.com/forums/thread67435.html
C++ Syntax (Toggle Plain Text)
#include <windows.h> #include <iostream> using namespace std; int main() { while ( 1 ) { Sleep ( 500 ); POINT pos; GetCursorPos ( &pos ); // here is your coordinates int x = pos.x; int y = pos.y; cout << "x pos:" << x << endl; cout << "y pos:" << y << endl << endl; } return 0; }
my output
C++ Syntax (Toggle Plain Text)
x pos:377 y pos:272 x pos:377 y pos:272 x pos:377 y pos:272 x pos:585 y pos:380 x pos:360 y pos:142 x pos:379 y pos:161 x pos:424 y pos:271 x pos:424 y pos:271 x pos:488 y pos:302 x pos:502 y pos:323 x pos:502 y pos:323
I don't know about visual c++ but the above seems to work in dev-cpp I think.
Last edited by iamthwee; Aug 22nd, 2008 at 1:01 pm.
*Voted best profile in the world*
![]() |
Similar Threads
Other Threads in the C++ Forum
- Previous Thread: error in script
- Next Thread: how to read a binary file data to a monitor
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count database delete deploy developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






