I am creating an automated test running application. In this part of the application, I am working on a polling server. It works by constantly polling the web server to de
I have not tested it, but if you invoke the WinForms Form, you should be back to the UI thread and most of the stuff should work again.
BackgroundWorker bgw = new BackgroundWorker();
bgw.DoWork += new DoWorkEventHandler(this.bgw_DoWork);
bgw.RunWorkerAsync();
private void bgw_DoWork(object sender, DoWorkEventArgs e)
{
// Invoke the UI thread
// "this" is referring to the Form1, or what ever your form is
this.Invoke((MethodInvoker)delegate
{
Clipboard.GetText();
// etc etc
});
}