Topaz Filer: if you use e-mail for business, we can save you money and decrease your risk.
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...
 
Auto-following on Twitter
Ubuntu and XP on one “desktop”
 
    
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...
 
Outlook interop - stopping user properties appearing on Outlook message print
Seriously, why is “cut and paste” majorly newsworthy???
 
    
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




Ad
BootFX
Reliable and powerful .NET application framework.
Recession Busting Bespoke Software
Get through the recession by investing in bespoke software to decrease costs and create commercial opportunities.
Other DN247 Network Sites
.NET 247
SQL Server Wins
Old Skool Developer
 
Copyright © AMX Software Ltd 2008-2009. Portions copyright © Matthew Baxter-Reynolds 2001-2009. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - .NET 247 is a member of the DN247 Network - 4.0.30129.1734