/ Published in: C++
Calculate the size of all the window borders + client area.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
void ClientResize(HWND hWnd, int nWidth, int nHeight) { RECT rcClient, rcWind; POINT ptDiff; GetClientRect(hWnd, &rcClient); GetWindowRect(hWnd, &rcWind); ptDiff.x = (rcWind.right - rcWind.left) - rcClient.right; ptDiff.y = (rcWind.bottom - rcWind.top) - rcClient.bottom; MoveWindow(hWnd,rcWind.left, rcWind.top, nWidth + ptDiff.x, nHeight + ptDiff.y, TRUE); }
URL: http://suite101.com/article/client-area-size-with-movewindow-a17846