Multimobile Development: Building Applications for any Smartphone
Adding extra title bar button
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.windowsforms.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

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?

Reply to this message...
Vote that this is a GOOD answer...
 
Really good experience at the Apple Store
MonoDroid – looking *awesome*
 
    
Saurabh
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

"Keith Patrick" <Click here to reveal e-mail address> wrote in message
news:u$Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
First volume of Multimobile Development nearly ready to go to press
A mention on Developing for the iPhone and Android: The pros and cons
 
    
Dmitriy Lapshin [C# / .NET MVP] (VIP)
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).

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Keith Patrick" <Click here to reveal e-mail address> wrote in message
news:u$Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
 
 
System.Type
System.Windows.Forms.ControlPaint




Multimobile Development: Building Applications for any Smartphone
Ad
BootFX
Reliable and powerful .NET application framework.
iOS, Android and Windows Phone Development Training and Consultancy
Hosted by RackSRV Communications
 
Multimobile Development: Building Applications for any Smartphone
Copyright © AMX Software Ltd 2008-2010. Portions copyright © Matthew Baxter-Reynolds 2001-2010. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - 4.0.30129.1734