Search

Clipboard WIn32 API for C#

PInvoke using the C#, this is a list of Win32 API to work with Clipboard
[DllImport("user32.dll")]
private static extern int OpenClipboard (int hwnd);
[DllImport("user32.dll")]
private static extern int GetClipboardData (int wFormat);
[DllImport("user32.dll", EntryPoint="GetClipboardFormatNameA")]
private static extern int GetClipboardFormatName (int wFormat, string lpString, int nMaxCount);
[DllImport("user32.dll")]
private static extern int GetClipboardOwner ();
[DllImport("user32.dll")]
private static extern int GetClipboardSequenceNumber ();
[DllImport("user32.dll")]
private static extern int GetClipboardViewer ();
[DllImport("kernel32.dll")]
private static extern int GlobalAlloc (int wFlags, int dwBytes);
[DllImport("kernel32.dll")]
private static extern int GlobalLock (int hMem);
[DllImport("kernel32.dll", EntryPoint="lstrcpyA")]
private static extern int lstrcpy (string lpString1, string lpString2);
[DllImport("kernel32.dll")]
private static extern int GlobalUnlock (int hMem);
[DllImport("user32.dll")]
private static extern int CloseClipboard ();
[DllImport("user32.dll")]
private static extern int SetClipboardData (int wFormat, int hMem);
[DllImport("user32.dll")]
private static extern int EmptyClipboard ();