I was using the WM_LBUTTONUP message to find the mouse coordinates.[/quote]
(Transform mouse coordinates from screen to client) now I'm doing it and the offset is really small[/quote]
If you're using the coordinates from LOWORD(lparam) and HIWORD(lparam) in your WM_LBUTTONUP case in the window procedure, they're already in client coordinates. Don't do any further conversion.
EDIT: shouldn't make a particular difference, but is there a reason you're using WM_LBUTTONUP rather than WM_LBUTTONDOWN?
EDIT2: see Endurion's post below. Failure to use AdjustWindowRect can cause very subtle problems. Good one!
Picking 3D objects with mouse give false positive
As Buckeye said.
There could also be a problem with the client area size. Does the back buffer size match the client area size? In other words, if you want to have a display size of say 800x600, do you use AdjustWindowRect(Ex) to calculate the real neeed window size?
There could also be a problem with the client area size. Does the back buffer size match the client area size? In other words, if you want to have a display size of say 800x600, do you use AdjustWindowRect(Ex) to calculate the real neeed window size?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement