我正在写一个Win32程序。
POINTS p = MAKEPOINTS(lParam);
ClientToScreen(hWnd, &p);
如何将p
转换为POINT
类型?
答案 0 :(得分:4)
答案 1 :(得分:2)
POINT
和POINTS
不是一回事。所以你必须要么:
将POINTS
复制到单独的POINT
:
POINTS ps = MAKEPOINTS(lParam);
POINT pt;
pt.x = ps.x;
pt.y = ps.y;
ClientToScreen(hWnd, &pt);
完全摆脱POINTS
并单独使用POINT
:
POINT pt;
pt.x = GET_X_PARAM(lParam);
pt.y = GET_Y_PARAM(lParam);
ClientToScreen(hWnd, &pt);