<p>How do you draw a custom button next to the minimize, maximize and close buttons within the Titlebar of the Form?</p>

<p>I know you need to use Win32 API calls and override the WndProc procedure, but I haven't been able to figure out a solution that works right.</p>

<p>Does anyone know how to do this? More specifically, does anyone know a way to do this that works in Vista?</p>

Drawing seems to be the easy part, the following will do that:
[Edit: Code removed, see my other answer]
The real problem is changing the state and detecting clicks on the button... for that you'll need to hook into the global message handler for the program, .NET seems to hide the mouse events for a form while not in the actual container areas (ie. mouse moves and clicks on the title bar). I'm looking for info on that, found it now, I'm working on it, shouldn't be too hard... If we can figure out what these messages are actually passing.