private void PositionButton(IntPtr hWnd, int right, int width) { InteropUtil.AssumeNonZero(hWnd); int id = InteropUtil.GetDlgCtrlID(hWnd); //hWnd.BringWindowToTop(); InteropUtil.WINDOWPLACEMENT buttonLoc = InteropUtil.GetWindowPlacement(hWnd); buttonLoc.Right = right; buttonLoc.Left = buttonLoc.Right - width; InteropUtil.SetWindowPlacement(hWnd, ref buttonLoc); InteropUtil.InvalidateRect(hWnd, IntPtr.Zero, true); }