public override void Run() { APIs.OpenClipboard(Process.GetCurrentProcess().MainWindowHandle); APIs.EmptyClipboard(); IntPtr iStr = Marshal.StringToHGlobalAnsi(data); APIs.SetClipboardData(1, iStr); Marshal.FreeHGlobal(iStr); APIs.CloseClipboard(); }