i am a student knowing about c++ . i have learned functions ,arrays ,structures,classes,basic programming and some what of files and graphics.
can you tell me about how to use mouse pointer in c++ programming, using a simple programming ?
can you explain about the functions used also ?
Hello gureinder, thank you for the question.
For mouse movement, I am afraid I only know Windows OS specific calls. The functions SetMousePos() and GetMousePos() will get and set the position of the mouse, and ShowCursor(bool) will toggle its visibility. The get and set methods take a POINT structure. Here is an example:
pnt.x = 100;
pnt.y = 100;
std::cout << "The new mouse point is: " << newPnt.x << " " << newPnt.y << '\n';
This is how you use those functions.
If you need any further explantion, please do not hesistate to ask.
I hope this information was helpful.