Right, that's not going to work. Windows is waiting for you to start pumping messages again. A workaround is to delay setting the flag back to true until all pending messages were dispatched. That can be elegantly done by using the Control.BeginInvoke() method. Like this:
private void some_event(object sender, EventArgs e)
{
MainForm.IsClipboardListenerOn = false;
// some code that makes the clipboard changed message fire
//...
this.BeginInvoke(new Action(() => MainForm.IsClipboardListenerOn = true));
}
With the assumption that some_event() is a member of a form. I'd guess that MainForm.BeginInvoke() would work as well.