Adding extra title bar button

  • Thread starter Thread starter Keith Patrick
  • Start date Start date
K

Keith Patrick

I have an extension to the Windows shell I want to write where I need an
extra button by the max/min/close buttons. Does anyone have an idea where I
would start looking to find out how to do this?
 
Keith,

I think you should start looking at the non-client events such as
WM_NCPAINT, WM_NCLDBLCLICK and their managed counterparts if they exists. In
the worst case, you can always override the WndProc method and handle these
events in the old-fashioned way (I mean a switch statement analyzing the
type of the event and calling the appropriate handler routine).
 
I achieved this by over-riding the WndProc and handling the WM_NCPAINT. I
draw the button using the ControlPaint class which has DrawButton,
DrawCheckBox and other methods.... though I am unable to trap the mouse
clicks in the area of title bar where i painted the button. I have posted a
fresh post asking whether its a bug in Type.GetType() probably that will be
your second step....

BTW, I could not find any way of painting a button in title bar through
..NET, This was done by getting the DC of window and painting on it.

--Saurabh
 
Back
Top