4条回答 默认 最新
- 战在春秋 2017-04-03 13:54关注
应该用:
xPos = GET_X_LPARAM(lParam); yPos = GET_Y_LPARAM(lParam);
如下引用自https://msdn.microsoft.com/en-us/library/windows/desktop/ms645607(v=vs.85).aspx
Do not use the LOWORD or HIWORD macros to extract the x- and y- coordinates of the cursor position because these macros return incorrect results on systems with multiple monitors. Systems with multiple monitors can have negative x- and y- coordinates, and LOWORD and HIWORD treat the coordinates as unsigned quantities.
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报