Possible Duplicate:
Get Current Cursor Position
I creating the button like this:
button = CreateWindowEx(NULL,_T("Button"),NULL,
WS_CHILD | WS_VISIBLE | BS_BITMAP | BS_NOTIFY ,
pos.x, pos.y, BTN_SIZE, BTN_SIZE,
hWndDlg, (HMENU)id,hIns, NULL);
I want to drag that button,can`t figure out how to get the mouse pos X,Y relatively DialogWindow?
Thank you for any help?
The message you received contains a
POINTstructure namedpt. At least for any mouse-originated message, that’s the position of the mouse at the time of the message. That’s in screen coordinates, so you’ll need to useScreenToClientor (preferably)MapWindowPointsto get coordinates relative to your dialog.