I'm deliberately abusing the message loop in a Windows Forms application, but my "just for fun" project quickly progressed beyond my level of understanding. While the task is running the form is unresponsive. Yes, there are lots of other questions like this, but in my case I am deliberately avoiding work on another thread (to win a bet against myself?)

I have a function that runs for (many) short slices of time on the UI thread: `get_IsComplete()` checks if the task is complete; `DoWork()` loops from 0 to 1000 (just to keep the CPU warm). The task is started up by calling `control.BeginInvoke(new Action(ContinueWith), control);` whereupon it (tail recursively) calls itself until completion, always running a short slice of work on the UI thread.

```
public void ContinueWith(Control control)
{
    if (!IsComplete)
    {
        DoWork();
        OnNext(control);
        control.BeginInvoke(new Action(ContinueWith), control);
    }
    else
    {
        OnCompleted(control);
    }
}
```

I expected the application to process other events (mouse clicks, control repaints, form moves etc.) but it seems my calls are getting more priority than I'd like.

Any suggestions?