static SetWindowPosOptions ClearUndefined(SetWindowPosOptions input) { SetWindowPosOptions retVal = 0; foreach (SetWindowPosOptions val in Enum.GetValues(typeof(SetWindowPosOptions))) { if ((input & val) == val) { retVal |= val; } } return retVal; }