What follows is a re-post from an older blog of mine:
---
I've been meaning to write about this for some time. It seems there
are certain functions in every library that you, as a humble programmer,
were never meant to use, yet they're somehow "there". One example of
this is the infamous Application.DoEvents function which, to me, does
more harm than good. These are the functions you were never meant to
call; the functions I refer to as blacklisted APIs. I will now
share with you my present list of blacklisted APIs, the functions that
you should never EVER call in your applications...
.NET - Blacklisted APIs - “The functions you were never meant
to call“
- Screen.GetWorkingArea() - Use instead,
Screen.PrimaryScreen.WorkingArea (For some reason, GetWorkingArea takes
25 ms to complete)
- Application.DoEvents() - The call of the devil.
- Control.RecreateHandle() - There's no reason why you should ever
need to use this.
- Application.EnableVisualStyles() - Use a manifest. .NET 1.1 just
doesn't implement this function right.
- NativeWindow.ReleaseHandle() - Contains some nasty bugs.