Jump to content
  • Advertisement
Sign in to follow this  
Origanlmaxin

mouse problem

This topic is 4862 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

ok... this looks like the right forum for this i hope.. im making my program to work on my winXP computer. its going alright but i cant seem to work out mouse clicks in my program.. in the windows message loop my program picks up the mouse click but i cant get the x and y positions of the mouse. MSDN said that this code should do it.. xPos = GET_X_LPARAM(lParam); yPos = GET_Y_LPARAM(lParam); but i get this error: implicit declaration of function `int GET_X_LPARAM(...)' implicit declaration of function `int GET_Y_LPARAM(...)' now ive figured that this is because im not linking the appropriate library? if so then im stumped cause ive had trouble on librarys before.. how do i know what library to link? because i dont have a list of librarys anywhere and when i come across code like the above on sites like MSDN they dont say any specific library to link.. just that you use that code? so tho problems there.. does anyone know how to fix the mouse position problem? or anyone know how to fix my unknowingness of different librarys?

Share this post


Link to post
Share on other sites
Advertisement
The MSDN appears to be out of date on that one (at least I couldn't find the macros in any of the include files).

However, the MSDN also states that:

Quote:

The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.

The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.


So you can use the LOWORD and HIWORD macros instead. These are defined thus:

#define LOWORD(l) ((WORD)((DWORD_PTR)(l) & 0xffff))
#define HIWORD(l) ((WORD)((DWORD_PTR)(l) >> 16))

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!