Win32/MFC Get window rect from client rect

Question!

I know there is a function somewhere that will accept a client rect and it will convert it into a window rect for you. I just can't find / remember it!

Does anyone know what it is?

It will do something similar to:

const CRect client(0, 0, 200, 200);
const CRect window = ClientRectToWindowRect(client);
SetWindowPos(...)


Answers

For control reposition use:

RECT client;
::SetRect(&client, 0, 0, 200, 200);
::MapWindowPoints(hwndControl, ::GetParent(hwndControl), (POINT*)&client, 2);
::SetWindowPos(...)
By : aMarCruz


If you want to map client co-ordinates to window co-ordinates use the ClientToWindow API.

If you want to map client co-ordinates to screen co-ordinates use the ClientToScreen API.

By : jussij


Is this what you are looking for?

ClientToScreen

http://msdn.microsoft.com/en-us/library/ms532670(VS.85).aspx

By : Ken


This video can help you solving your question :)
By: admin