I've been working on developing a custom UI for one of my recent programs, and decided to make my own form. The problem is that since I override the OnPaint method of the form and I can't draw into the non-client area I must set the form border style to none, and therefore the main form loses a lot of its functions.

I've alrady implement some of these features, but there are two I still wonder how to re-implement, one is the possibility of minimizing the program when I single-clicking the "program description" (I don't know its correct name) on the taskbar, and the other is the menu that appears when you right-click on it. I guese both are managed by some API, but I don't know which one.

Another option would be subclassing the form and so allowing me to draw to the non-client area, but I prefer not to swich to this one if possible, since I already have the rest of the logic for the previous way. I know this would be easier using WPF, but there are several points making it not an option right now.