@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The CloseClipboard API !!!!C# Signature: [DllImport("user32.dll", SetLastError=true)] static extern bool CloseClipboard(); !!!!User-Defined Types: None. !!!!Notes: None. !!!!Tips & Tricks: I read on google about a flaw in the .Net System.Windows.Forms.Clipboard.SetDataObject where you had to run the SetDataObject function twice for it to work. On the first try it would just error out and the second with work just fine. Well I found that by using the 3 clipboard API's below first it work every time and you don't have to wait for the error. !!!!Sample Code: OpenClipboard(IntPtr.Zero); EmptyClipboard(); CloseClipboard(); try { System.Windows.Forms.Clipboard.SetDataObject("your message here \n if you would like", true); } catch { try { System.Windows.Forms.Clipboard.SetDataObject("your message here \n if you would like", true); } catch { }; } !!!!Alternative Managed API: System.Windows.Forms.Clipboard.SetDataObject("your message here \n if you would like", true); Documentation: CloseClipboard@msdn on MSDN
Edit user32.CloseClipb...
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.