Try this function inside WM_SIZE. Pass your button handle as the parameter.
Code:/* * Places a control at the bottom right of it's parent. */ void MakeBottomRight( HWND button ) { RECT rcClient, rcButton ; HWND hwndParent ; int newButtonX, newButtonY ; if ( !IsWindow(button) ) return ; hwndParent = GetParent(button); if ( !IsWindow(hwndParent) ) return ; GetClientRect( hwndParent, &rcClient ); GetClientRect( button, &rcButton ); newButtonX = rcClient.right - rcButton.right ; newButtonY = rcClient.bottom - rcButton.bottom ; SetWindowPos( button, NULL, newButtonX, newButtonY, 0, 0, SWP_NOSIZE|SWP_NOZORDER ); }



LinkBack URL
About LinkBacks



