I was wondering if there is a way to add (programmatically, of course) the icon / button / regardless of the plain text in the title bar of the Microsoft Windows window ... or next to where the minimize / maximize / close buttons are. I could do it myself and create the illusion that this is part of the window, but I'm wondering if there is such a method in user32 api.
So far, I have found a way to disable the Minimize / Enlarge / Close buttons, but not a way to add a custom one. It seems strange to me.
Here is what I am trying to achieve:

I was wondering how this is done here, since drawing a button for each window using gdi / gdi +, and then detecting if it is overlapped by another window, and then displaying only the part without overlapping seems to me an unlikely solution. The button was probably registered in the window class, so each window has this button. Any pointers what to do?
Also, how do I create a button at all, assuming I am NOT UNICODED. Then in the following code snippet:
HWND hwndCommandLink = CreateWindow(
L"BUTTON",
L"",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_COMMANDLINK,
10,
10,
100,
100,
hDlg,
NULL,
(HINSTANCE)GetWindowLong(hDlg, GWL_HINSTANCE),
NULL);
SendMessage(clHwnd, WM_SETTEXT, 0, (LPARAM)L"Command link");
SendMessage(clHwnd, BCM_SETNOTE, 0, (LPARAM)L"with note");
I need to replace all the good Windows constants with their long equivalent ... However, when I look for them, all I get is:
http://msdn.microsoft.com/en-us/library/bb775951(v=VS. 85) .aspx
Any pointers?