public static async Task EnsureAsync( IntPtr hwnd, int interval, CancellationToken token) { while (!WinApi.OpenClipboard(hwnd)) { await Task.Delay(interval, token); } WinApi.CloseClipboard(); token.ThrowIfCancellationRequested(); }