@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The GetClipboardData API !!!!C# Signature: [DllImport("user32.dll")] static extern IntPtr GetClipboardData(uint uFormat); !!!!User-Defined Types: None. !!!!Notes: None. !!!!Tips & Tricks: Please add some! !!!!Sample Code: [DllImport("user32.dll")] static extern IntPtr GetClipboardData(uint uFormat); /// <summary> /// Gets the data on the clipboard in the format specified by the selected item of the specified listbox. /// </summary> private byte[] GetClipboardData(ListBox ListBox) { uint SelectedFormat = GetSelectedClipboardFormat(ListBox); if (SelectedFormat != 0) { OpenClipboard(Handle); //Get pointer to clipboard data in the selected format IntPtr ClipboardDataPointer = GetClipboardData(SelectedFormat); //Do a bunch of crap necessary to copy the data from the memory //the above pointer points at to a place we can access it. UIntPtr Length = GlobalSize(ClipboardDataPointer); IntPtr gLock = GlobalLock(ClipboardDataPointer); //Init a buffer which will contain the clipboard data byte[] Buffer = new byte[(int)Length]; //Copy clipboard data to buffer Marshal.Copy(gLock, Buffer, 0, (int)Length); GlobalUnlock(gLock); //unlock gLock CloseClipboard(); return Buffer; } return new byte[] {}; } !!!!Alternative Managed API: Do you know one? Please contribute it! Documentation: GetClipboardData@msdn on MSDN
Edit user32.GetClipboa...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.