Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RECT windowRect;
- GetClientRect( &windowRect );// Bounds of the current window
- CWnd* controlWindow = GetDlgItem( controlId );
- RECT controlRect;
- controlWindow->GetWindowRect( &controlRect );//control rectangle
- ScreenToClient( &controlRect );//control rectangle in the coordinate system of the parent
- const int vertOffset = windowRect.top - controlRect.top;//how much to adjust
- controlRect.top += vertOffset;
- controlRect.bottom += vertOffset;
- controlWindow->MoveWindow( &controlRect );
Add Comment
Please, Sign In to add comment