Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   help with C++ code (http://www.go4expert.com/forums/help-cpp-code-t12354/)

Andres 23Jul2008 00:49

help with C++ code
Is there a way to get the coordinates of the mouse using C++ codes?

xpi0t0s 23Jul2008 15:20

Re: help with C++ code
what operating system? (there isn't only one)
what compiler are you using, and more importantly what class library or API are you using? (there are multiple compilers per platform and multiple APIs and class libraries)

Andres 23Jul2008 23:37

Re: help with C++ code
Well I am using Windows XP Professional SP2. I am using the Bloodshed Dev-C++ Version compiler. I am not sure of which library to use. Can you help me?

xpi0t0s 24Jul2008 01:48

Re: help with C++ code
Two ways come to mind; you can call GetCursorPos, which is part of the WinAPI, or you can check for WM_MOUSEMOVE in your message loop and pick up the position from lParam.

Andres 25Jul2008 19:58

Re: help with C++ code
I am new with C++ and don't know all the codes. Can you guide me on how I can start the program and then I'll take it from there please.

xpi0t0s 25Jul2008 20:19

Re: help with C++ code
If you've only just started I suggest you leave the GUI stuff until you've got the hang of the language. If you don't know how to call GetCursorPos then that sort of stuff is way too advanced for you at this stage.

All times are GMT +5.5. The time now is 07:54.