walterlv/ClipboardViewer

加上 GetOpenClipboardWindow 获取当前占用剪贴板的软件是哪个

Opened this issue · 0 comments

        private static void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var hwnd = GetOpenClipboardWindow();
            Console.WriteLine($"占用剪贴板 HWND={hwnd} LastError={Marshal.GetLastWin32Error()}");
        }

        [DllImport("User32", SetLastError = true)]
        extern static int GetOpenClipboardWindow();

需求: 我远程一个用户,他的系统里面剪贴板拷贝无限失败,预计是某个软件在占用剪贴