Guest User

Untitled

a guest
Jun 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. RECT windowRect;
  2. GetClientRect( &windowRect );// Bounds of the current window
  3.  
  4. CWnd* controlWindow = GetDlgItem( controlId );
  5. RECT controlRect;
  6. controlWindow->GetWindowRect( &controlRect );//control rectangle
  7. ScreenToClient( &controlRect );//control rectangle in the coordinate system of the parent
  8.  
  9. const int vertOffset = windowRect.top - controlRect.top;//how much to adjust
  10. controlRect.top += vertOffset;
  11. controlRect.bottom += vertOffset;
  12. controlWindow->MoveWindow( &controlRect );
Add Comment
Please, Sign In to add comment