Is there any way to temporarily disable ALL events on an windows form?
I have situation where processing on a secondary thread is being corrupted by events on the
If you want to suppress all events resulting from a PostMessage, then you can implement the IMessageFilter interface and use AddMessageFilter.
This will probably trap all of the events in which you're interested. It won't trap everything, for example an event resulting from a SendMessage. To trap absolutely everything, you will need a thread-specific application hook.
Note that this will cause the UI to freeze completely, which may not be what you want. A better apporach might be to intercept the appropriate events and suppress unwanted behaviour while your background work is in progress.