Hello,
I need to convert screen mouse coordinates to client coordinates.
I think this should be done with ScreentoClient, but I do not know how to refer to write the window argument.
Could anyone show me an example of Screentoclient?
Thanks for your help.
You'd declare it like this:
declare import,ScreenToClient(unsigned int hWnd, POINT *lppt), int;
In your code, you'd use the m_hWnd member of the CWindow derived class, doing something like:
POINT pt;
int bConverted;
// initialize the POINT struct to the coordinates you're interested in
// and then call ScreenToClient to convert it to client coordinates
bConverted = ScreenToClient(m_hWnd, &pt);
if (bConverted)
{
ÂÃ, Ã‚Ã, // do something with the converted coordinates
}
Edit: Spelling is not my strong suit :)
Thanks!
Exactly what I needed.
Thank's Mike
I needed that info as well.
/Lasse