IonicWind Software

Aurora Compiler => GUI => Topic started by: Haim on March 10, 2006, 12:09:10 AM

Title: ScreentoClient
Post by: Haim on March 10, 2006, 12:09:10 AM
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.

Title: Re: ScreentoClient
Post by: Mike Stefanik on March 10, 2006, 12:45:53 AM
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 :)
Title: Re: ScreentoClient
Post by: Haim on March 10, 2006, 01:09:28 AM
Thanks!
Exactly what I needed.
Title: Re: ScreentoClient
Post by: lviklund on March 10, 2006, 03:10:49 AM
Thank's Mike
I needed that info as well.

/Lasse