Jump to content
  • Advertisement
Sign in to follow this  
aleksi1578

This is...

This topic is 4899 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is very noobish question but i cant find information about this.. So does anyone know where i could find how to make the mouse things.. like moving to x,y . and also i need info how to see where the cursor is (x,y). any tutorials out there that tells about these mouse commands heh.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by eq
GetCursorPos
SetCursorPos


Cant get that GetCursorPos working i have tried everything i get this error...
--------------------Configuration: main - Win32 Debug--------------------
Compiling...
main.cpp
C:\Documents and Settings\.oO\My Documents\projects\main.cpp(10) : error C2373: 'GetCursorPos' : redefinition; different type modifiers
d:\programz\microsoft visual studio\vc98\include\winuser.h(6261) : see declaration of 'GetCursorPos'
Error executing cl.exe.

main.exe - 1 error(s), 0 warning(s)

Share this post


Link to post
Share on other sites
Can you post the (interesting) code of your main.cpp? It seems you are either using it wrong or there is some version conflict in the SDK, as far as I can tell now.

Greetz,

Illco

Share this post


Link to post
Share on other sites
Quote:
Original post by Illco
Can you post the (interesting) code of your main.cpp? It seems you are either using it wrong or there is some version conflict in the SDK, as far as I can tell now.

Greetz,

Illco


Well i have been just testing these out.. I havent got it working with any settings.. well here is it.. (its not even interesting just testing that function out to use it on my projects later.Need this for my little program at this moment.)
#include <iostream.h>
#include <windows.h>

void main ()
{
BOOL GetCursorPos(

LPPOINT lpPoint
);
cout << "Mouse position is :";
}
I hope this helps by the way dont notice about that mouse position thing its not mistake! oh and im using VC++ 6.0

Share this post


Link to post
Share on other sites
Why did you put the return type (i.e. BOOL) in front of the function call. The compiler thinks you are defining a function.

just do

void main ()
{
LPPOINT lpPoint;
GetCursorPos(lpPoint);
cout << "Mouse position is :"<<lppoint.x<<" "<<lppoint.y;
}

Share this post


Link to post
Share on other sites
Ok you're using it wrong. The more common way to do this is:

POINT ptCursorPos;
GetCursorPos( &ptCursorPos );


@snisarenko: that will not work. The function takes a pointer to a POINT structure. At the very least you'd have to access the members using lppoint->x and so on. However, the above sample is more common.

Share this post


Link to post
Share on other sites
I cant still get it.. I guess im too stupid for win api commands. Can you give example or something? and detailed description.. im sry for bothering you guys heh..

Share this post


Link to post
Share on other sites
Quote:
Original post by aleksi1578
I cant still get it.. I guess im too stupid for win api commands. Can you give example or something? and detailed description.. im sry for bothering you guys heh..


Forget it.. got it now thanks guys :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!