Originally Posted by BobS0327 You're not allocating any memory for lpPoint. Code: lpPoint = (LPPOINT)GlobalAlloc(GPTR, sizeof(POINT)); Code: POINT Point; if(!GetCursorPos(&Point)) would be simpler in this case. If you really want to put it on the heap, new would be simpler than GlobalAlloc.
lpPoint = (LPPOINT)GlobalAlloc(GPTR, sizeof(POINT));
POINT Point; if(!GetCursorPos(&Point))
Forum Rules