How do you draw a custom button next to the minimize, maximize and close buttons within the Titlebar of the Form?
I know you need to use Win32 API calls and override
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.