<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://www.codeplex.com/rss.xsl"?><rss version="2.0"><channel><title>Drawing Custom Borders in Windows Forms</title><link>http://www.codeplex.com/CustomerBorderForm/Project/ProjectRss.aspx</link><description>This project is a small library that extends Windows Forms with ability to customize the windows&amp;#39;s non-client area. This allows you to create custom skins for any window and give your application&amp;#160;c...</description><item><title>NEW POST: Minimize/Restore with hidden caption bar makes window shrink/grow</title><link>http://www.codeplex.com/CustomerBorderForm/Thread/View.aspx?ThreadId=3049</link><description>&lt;div class="wikidoc"&gt;
The same problem exist for  all custom drawn forms (my own also) . May be the author of this code fix the problem.&lt;br /&gt;The minimize restore problem exist if height of the caption  (by changing client area) is changed. If it is kept as the standard OS height you will not get this issue.&lt;br /&gt;
&lt;/div&gt;</description><author>santhosh</author><pubDate>Tue, 22 Apr 2008 06:17:20 GMT</pubDate><guid isPermaLink="false">NEW POST: Minimize/Restore with hidden caption bar makes window shrink/grow 20080422061720A</guid></item><item><title>COMMENTED ISSUE: MDI support</title><link>http://www.codeplex.com/CustomerBorderForm/WorkItem/View.aspx?WorkItemId=2246</link><description>I have no specific issues - I have not tested the code at this time.  However, reading the multiple comments on the blog, along with no reply answering them, comes this&amp;#58;&lt;br /&gt;&lt;br /&gt;MDI support.  Custom border forms should support the effortless switch between MDI and SDI that .net implements for standard forms.  Behavior should be identical, and translation of screen coordinates should be automatic &amp;#40;from screen position to clientarea position within the parent&amp;#41;.  Child forms should be separately skinnable from the parent, and the parent should be skinnable as well.&lt;br /&gt;&lt;br /&gt;If this has already been addressed, please notify me &amp;#40;glacialfury&amp;#64;gmail.com&amp;#41; and remove this ticket.&lt;br /&gt;&lt;br /&gt;Thank you for this project - I will be reading through it extensively in the coming weeks.&lt;br /&gt;&lt;br /&gt;glacialfury&lt;br /&gt;Comments: ** Comment from web user: BillKrat ** &lt;p&gt;I provide a work-around in the Discussion area under the topic &amp;#34;MDI Forms do not work correctly&amp;#34;&lt;/p&gt;</description><author>BillKrat</author><pubDate>Wed, 30 Jan 2008 00:14:30 GMT</pubDate><guid isPermaLink="false">COMMENTED ISSUE: MDI support 20080130121430A</guid></item><item><title>NEW POST: MDI Forms do not work correctly</title><link>http://www.codeplex.com/CustomerBorderForm/Thread/View.aspx?ThreadId=21244</link><description>&lt;div class="wikidoc"&gt;
 &lt;br /&gt;I'm utilizing this work-around with the Smart Client Software Factory (for the Shell and my views)&lt;br /&gt; &lt;br /&gt;The problem becomes evident by debugging the OnNonClientAreaHitTest(Point p) - the MDI Parent's button.Bounds will correctly hold it's coordinates but the MDI child will have incorrect values; the x and y coordinates are relative to itself where the received parameter (Point p), that it is compared to, are relative to the MDI Parent.&lt;br /&gt; &lt;br /&gt;The workaround that I provide below will allow you to &lt;b&gt;move&lt;/b&gt; and &lt;b&gt;close&lt;/b&gt; a MDI Child form (these are all I required and time-constraints don't permit me to take it further); in addition, and for the same reason, I hard-coded the values to the stock &amp;quot;VistaForm&amp;quot; skin; you may need to tweak the values in the CompensateForMDI() method.  &lt;br /&gt; &lt;br /&gt;&lt;b&gt;SkinRenderForm.cs&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
protected override int OnNonClientAreaHitTest(Point p)
{
    if (ActiveFormSkin == null)
        return (int)NativeMethods.NCHITTEST.HTCLIENT;
 
    foreach (CaptionButton button in this.CaptionButtons)
    {
        if (button.Visible &amp;amp;&amp;amp; button.Bounds.Contains(p) &amp;amp;&amp;amp; (button.HitTestCode &amp;gt; 0 || button.HitTestCode &amp;lt; -1))
            return button.HitTestCode;
    }
 
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;NonClientBaseForm.cs&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;CompensateForMDI() is a new method and the methods that implement this new method follow below:&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
protected Point CompensateForMDI(Point p)
{
    bool IsParent = Parent != null;
    if (IsParent)
    {
        p.X -= Parent.Parent.Location.X + 10;
        p.Y -= (Parent.Parent.Location.Y + 75);
    }
    return p;
}
 
 
private void WmNCHitTest(ref Message m)
{
    // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/mouseinput/mouseinputreference/mouseinputmessages/wm_nchittest.asp
 
    Point screenPoint = CompensateForMDI(new Point(m.LParam.ToInt32()));
 
    Log(MethodInfo.GetCurrentMethod(), string.Format(&amp;quot;### Screen Point ({0},{1})&amp;quot;, screenPoint.X, screenPoint.Y));
 
    // convert to local coordinates
    Point clientPoint = PointToWindow(screenPoint);
    Log(MethodInfo.GetCurrentMethod(), string.Format(&amp;quot;### Client Point ({0},{1})&amp;quot;, clientPoint.X, clientPoint.Y));
    m.Result = new System.IntPtr(OnNonClientAreaHitTest(clientPoint));
}
 
private void WmNCMouseMove(ref Message msg)
{
    // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/mouseinput/mouseinputreference/mouseinputmessages/wm_nchittest.asp
    Point clientPoint = CompensateForMDI(this.PointToWindow(new Point(msg.LParam.ToInt32())));
    OnNonClientMouseMove(new MouseEventArgs(MouseButtons.None, 0,
        clientPoint.X, clientPoint.Y, 0));
    msg.Result = IntPtr.Zero;
}
 
 
private void WmNCLButtonDown(ref Message msg)
{
    Point pt = CompensateForMDI(this.PointToWindow(new Point(msg.LParam.ToInt32())));
    NonClientMouseEventArgs args = new NonClientMouseEventArgs(
        MouseButtons.Left, 1, pt.X, pt.Y, 0, msg.WParam.ToInt32());
    OnNonClientMouseDown(args);
    if (!args.Handled)
    {
        DefWndProc(ref msg);
    }
    msg.Result = NativeMethods.TRUE;
}
 
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;SkinRenderForm.cs&lt;/b&gt;  &lt;br /&gt; &lt;br /&gt;The &amp;quot;|| Parent!=null&amp;quot; statement is the only change&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
protected override void OnNonClientMouseDown(NonClientMouseEventArgs args)
{
    if (args.Button != MouseButtons.Left)
        return;
 
    // custom button
    foreach (CaptionButton button in this.CaptionButtons)
        if (args.HitTest &amp;gt; short.MaxValue &amp;amp;&amp;amp; args.HitTest == button.HitTestCode &amp;amp;&amp;amp; button.Visible &amp;amp;&amp;amp; button.Enabled)
        {
            ((CustomCaptionButton)button).OnClick();
            args.Handled = true;
            return;
        }
 
    // find appropriate button
    foreach (CaptionButton button in this.CaptionButtons)
    {
        // [1530]: Don't execute any action when button is disabled or not visible.
        if (args.HitTest == button.HitTestCode &amp;amp;&amp;amp; button.Visible &amp;amp;&amp;amp; button.Enabled)
        {
            Log(MethodInfo.GetCurrentMethod(), &amp;quot;MouseDown: button = {0}&amp;quot;, button);
 
            if (DepressButton(button) || Parent!=null)
            {
&lt;/pre&gt;
&lt;/div&gt;</description><author>BillKrat</author><pubDate>Wed, 30 Jan 2008 00:13:25 GMT</pubDate><guid isPermaLink="false">NEW POST: MDI Forms do not work correctly 20080130121325A</guid></item><item><title>NEW POST: Can I get the compiled dlls?</title><link>http://www.codeplex.com/CustomerBorderForm/Thread/View.aspx?ThreadId=14415</link><description>&lt;div class="wikidoc"&gt;
I can't compile the dll's with C# Express.  Can someone else give me a compiled version?&lt;br /&gt; &lt;br /&gt;daw mail 333 (@t) g mail (dOt) com&lt;br /&gt; &lt;br /&gt;(Just take out the spaces and replace the words in brackets)&lt;br /&gt;
&lt;/div&gt;</description><author>dawmail333</author><pubDate>Tue, 28 Aug 2007 12:03:30 GMT</pubDate><guid isPermaLink="false">NEW POST: Can I get the compiled dlls? 20070828120330P</guid></item><item><title>NEW POST: Minimize/Restore with hidden caption bar makes window shrink/grow</title><link>http://www.codeplex.com/CustomerBorderForm/Thread/View.aspx?ThreadId=3049</link><description>&lt;div class="wikidoc"&gt;
Hi, were you able to solve this problem?&lt;br /&gt;Thanks&lt;br /&gt;
&lt;/div&gt;</description><author>joaomaia</author><pubDate>Tue, 07 Aug 2007 11:13:20 GMT</pubDate><guid isPermaLink="false">NEW POST: Minimize/Restore with hidden caption bar makes window shrink/grow 20070807111320A</guid></item><item><title>COMMENTED ISSUE: MDI support</title><link>http://www.codeplex.com/CustomerBorderForm/WorkItem/View.aspx?WorkItemId=2246</link><description>I have no specific issues - I have not tested the code at this time.  However, reading the multiple comments on the blog, along with no reply answering them, comes this:

MDI support.  Custom border forms should support the effortless switch between MDI and SDI that .net implements for standard forms.  Behavior should be identical, and translation of screen coordinates should be automatic (from screen position to clientarea position within the parent).  Child forms should be separately skinnable from the parent, and the parent should be skinnable as well.

If this has already been addressed, please notify me (glacialfury@gmail.com) and remove this ticket.

Thank you for this project - I will be reading through it extensively in the coming weeks.

glacialfury Comments: ** Comment from web user: Puppie ** &lt;p&gt;A&amp;#43;&amp;#43;&amp;#43; for the code mate - really nice example and showing how things work under the hood... I recently attempted to imcorportate this into an MDI sample to see how it would handle and came across issues where the child form&amp;#39;s &amp;#34;skin&amp;#34; was not being picked up correctly and the buttons were not able to be pressed...&lt;/p&gt;&lt;p&gt;Any ETA on when the next release will be out with this incorporated&amp;#63;&lt;/p&gt;</description><author>Puppie</author><pubDate>Fri, 04 May 2007 14:12:36 GMT</pubDate><guid isPermaLink="false">COMMENTED ISSUE: MDI support 20070504021236P</guid></item><item><title>NEW POST: Enhancing the performance of the paint method</title><link>http://www.codeplex.com/CustomerBorderForm/Thread/View.aspx?ThreadId=9573</link><description>&lt;div class="wikidoc"&gt;
Hi!&lt;br /&gt;First of all, thumbs up for such a good work done!!&lt;br /&gt; &lt;br /&gt;Now, the only problem which I see is that once there are lot of controls put on the form or the form is minimized, and maximized again and again, i.e., &lt;b&gt;Paint method is raised again and again&lt;/b&gt;. The form just goes down.&lt;br /&gt; &lt;br /&gt;I just want to discuss whether there is any way we can increase the performance of the Paint method (WndProc otherwise).&lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>amitbhandari</author><pubDate>Wed, 25 Apr 2007 07:12:45 GMT</pubDate><guid isPermaLink="false">NEW POST: Enhancing the performance of the paint method 20070425071245A</guid></item><item><title>COMMENTED ISSUE: Windows Vista compatibility</title><link>http://www.codeplex.com/CustomerBorderForm/WorkItem/View.aspx?WorkItemId=2542</link><description>Custom Border Form does not work very well in Windows Vista. Comments: ** Comment from web user: mynab ** &lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;thanks for the fix although we loose the clip siblings option. In my About box where I have a textbox above the custom background, the textbox disappears when hovered...&lt;/p&gt;&lt;p&gt;So I think we need a true Vista compatibility.&lt;br/&gt;Thanks&lt;/p&gt;</description><author>mynab</author><pubDate>Thu, 08 Feb 2007 21:17:58 GMT</pubDate><guid isPermaLink="false">COMMENTED ISSUE: Windows Vista compatibility 20070208091758P</guid></item><item><title>CREATED ISSUE: Windows Server 2003 Issues</title><link>http://www.codeplex.com/CustomerBorderForm/WorkItem/View.aspx?WorkItemId=7111</link><description>It appears that Windows Server 2003 (Enterprise Edition) has problems rendering the styles. When the program first starts up, the custom style is completely invisible. However, the functionality and buttons still work. (You just can't see it.) It seems that if the window is resized, it will correctly redraw the style. If it is minimized and restored, it will become invisible again.

It does not matter whether the Themes service is on or off. It also does not matter if it is done via Remote Desktop. </description><author>ThomasKaiser</author><pubDate>Mon, 08 Jan 2007 19:48:57 GMT</pubDate><guid isPermaLink="false">CREATED ISSUE: Windows Server 2003 Issues 20070108074857P</guid></item><item><title>Developer Forum: Minimize/Restore with hidden caption bar makes window shrink/grow</title><link>http://www.codeplex.com/CustomerBorderForm/Project/DisplayThread.aspx?ForumId=448&amp;ThreadId=3049&amp;ANCHOR#LastPost</link><description>First of all. I just downloaded the source and do not know if this issue has been up here before. But anyhow. Here I go:

How to reproduce:

Im running XP SP2 - classic mode...

1) I downloaded version 6125 of the source code.
2) Start the Demo sample.
3) Check the "Enable custom borders" checkbox.
4) Minimize the Demo window
5) Restore the Demo window

Result:
After restoring the window, it's height has increased (compared to when it was minimized).

Excpected behaviour:
The window should have the same size after it has been restored as it had before being minimized.

Notes:
The same behaviour exists when the following is done:
1) "Show desktop" (Win+D or Win+M) 
2) Restore the Demo window. 

I now that the same windows messages are not sent in this case compared to the above, but it should behave the same way. </description><author>Hammer</author><pubDate>Thu, 21 Dec 2006 08:37:48 GMT</pubDate><guid isPermaLink="false">Developer Forum: Minimize/Restore with hidden caption bar makes window shrink/grow 20061221083748A</guid></item><item><title>CREATED ISSUE: Minimize/Restore with hidden caption bar makes window shrink/grow</title><link>http://www.codeplex.com/WorkItem/View.aspx?ProjectName=CustomerBorderForm&amp;WorkItemId=5905</link><description>First of all. I just downloaded the source and do not know if this issue has been up here before. But anyhow. Here I go:

How to reproduce:

Im running XP SP2 - classic mode...

1) I downloaded version 6125 of the source code.
2) Start the Demo sample.
3) Check the "Enable custom borders" checkbox.
4) Minimize the Demo window
5) Restore the Demo window

Result:
After restoring the window, it's height has increased (compared to when it was minimized).

Excpected behaviour:
The window should have the same size after it has been restored as it had before being minimized.

Notes:
The same behaviour exists when the following is done:
1) "Show desktop" (Win+D or Win+M) 
2) Restore the Demo window. 

I now that the same windows messages are not sent in this case compared to the above, but it should behave the same way. </description><author>Hammer</author><pubDate>Fri, 24 Nov 2006 12:52:01 GMT</pubDate><guid isPermaLink="false">CREATED ISSUE: Minimize/Restore with hidden caption bar makes window shrink/grow 20061124125201P</guid></item><item><title>Project Management Forum: Pass on to Ascend if you're losing steam</title><link>http://www.codeplex.com/Project/DisplayThread.aspx?ProjectName=CustomerBorderForm&amp;ForumId=449&amp;ThreadId=2461&amp;ANCHOR#LastPost</link><description>I'd love to see this project continue on and if you guys are losing steam could you reconsider passing this project on to the Ascend group?

Just a thought.</description><author>rgardner</author><pubDate>Mon, 20 Nov 2006 06:31:01 GMT</pubDate><guid isPermaLink="false">Project Management Forum: Pass on to Ascend if you're losing steam 20061120063101A</guid></item><item><title>COMMENTED ISSUE: Windows Vista compatibility</title><link>http://www.codeplex.com/WorkItem/View.aspx?ProjectName=CustomerBorderForm&amp;WorkItemId=2542</link><description>Custom Border Form does not work very well in Windows Vista. Comments: ** Comment from web user: kpfile ** &lt;p&gt;I was able to resolve this issue.  In the PaintNonClient area function, &lt;br/&gt; &amp;#47;&amp;#47;IntPtr hDC &amp;#61; NativeMethods.GetDCEx&amp;#40;hWnd, hRgn,&lt;br/&gt;            &amp;#47;&amp;#47;    &amp;#40;int&amp;#41;&amp;#40;NativeMethods.DCX.DCX_WINDOW &amp;#124; NativeMethods.DCX.DCX_INTERSECTRGN&lt;br/&gt;            &amp;#47;&amp;#47;        &amp;#124; NativeMethods.DCX.DCX_CACHE &amp;#124; NativeMethods.DCX.DCX_CLIPSIBLINGS&amp;#41;&amp;#41;&amp;#59;&lt;/p&gt;&lt;p&gt;Is called.  This function is not working correctly in Windows XP 64 bit or Windows Vista.  It will return the null pointer in some cases.  &lt;br/&gt;       &lt;br/&gt;            IntPtr hDC &amp;#61; NativeMethods.GetWindowDC&amp;#40;hWnd&amp;#41;&amp;#59;&lt;br/&gt;This second call works correctly in all OSes i&amp;#39;ve tested from Win2k to Vista RC2 64 bit.  I&amp;#39;m not quite sure what the problem is, or what I lose by calling it instead, but it works.&lt;/p&gt;&lt;p&gt;&amp;#40;add the following to NativeMethods&amp;#41;&lt;br/&gt;        &amp;#91;DllImport&amp;#40;&amp;#34;user32.dll&amp;#34;&amp;#41;&amp;#93;&lt;br/&gt;        public static extern IntPtr GetWindowDC&amp;#40;IntPtr hwnd&amp;#41;&amp;#59;&lt;/p&gt;</description><author>kpfile</author><pubDate>Thu, 16 Nov 2006 22:04:23 GMT</pubDate><guid isPermaLink="false">COMMENTED ISSUE: Windows Vista compatibility 20061116100423P</guid></item><item><title>Developer Forum: RE: Use project in VB.NET</title><link>http://www.codeplex.com/Project/DisplayThread.aspx?ProjectName=CustomerBorderForm&amp;ForumId=448&amp;ThreadId=1662&amp;ANCHOR#LastPost</link><description>Hi CaptnKebec,

Is there any chance I could please get a copy of your VB.NET (converted) solution?

/evan</description><author>evan1979</author><pubDate>Thu, 09 Nov 2006 03:39:07 GMT</pubDate><guid isPermaLink="false">Developer Forum: RE: Use project in VB.NET 20061109033907A</guid></item><item><title>Developer Forum: Skining with OpenGL</title><link>http://www.codeplex.com/Project/DisplayThread.aspx?ProjectName=CustomerBorderForm&amp;ForumId=448&amp;ThreadId=2004</link><description>Take a look at :

http://www.codeproject.com/useritems/BLACK_BOX_II.asp</description><author>cdemez</author><pubDate>Tue, 24 Oct 2006 09:00:15 GMT</pubDate><guid isPermaLink="false">Developer Forum: Skining with OpenGL 20061024090015A</guid></item><item><title>Project Management Forum: RE: Next Release</title><link>http://www.codeplex.com/Project/DisplayThread.aspx?ProjectName=CustomerBorderForm&amp;ForumId=449&amp;ThreadId=1510</link><description>you guys still working on this project?</description><author>rgardner</author><pubDate>Tue, 24 Oct 2006 03:03:06 GMT</pubDate><guid isPermaLink="false">Project Management Forum: RE: Next Release 20061024030306A</guid></item><item><title>Developer Forum: Bug dragging</title><link>http://www.codeplex.com/Project/DisplayThread.aspx?ProjectName=CustomerBorderForm&amp;ForumId=448&amp;ThreadId=1902</link><description>Hi, everybody:
Two things:
1.-I don't know if you have found this problem.
When i open a form with a design using the custom borders and i click down and drag one of the buttons (close or minimize...) and then click up outside the button, we can see how the original Framework buttons appear.


2.-Another thing, how can i create the fsl file.

Salud,
Dactivo
http://www.d-activo.com
</description><author>dactivo</author><pubDate>Wed, 18 Oct 2006 15:50:22 GMT</pubDate><guid isPermaLink="false">Developer Forum: Bug dragging 20061018035022P</guid></item><item><title>Developer Forum: New enhancement request</title><link>http://www.codeplex.com/Project/DisplayThread.aspx?ProjectName=CustomerBorderForm&amp;ForumId=448&amp;ThreadId=1901</link><description>Something to consider that would be very useful for us application developers. My application, as I'm sure others, has other details about the "skin" that your tool is not capturing. Things like accent colors, icons, border sizes, etc.
What would be really helpful is if you provided a dictionary in your editor that designers could enter in custom name value pairs of properties. And then in your api allow application developers access to those properties by name. This way we could go to one place for skin generation instead of having to code up another specific editor just for those parts that fall outside of your utility.
** It would be even cooler if that collection was typed and the editor did things like chose color or serialized images just as it does with the built-in types.

Thanks, good job so far. I hope you guys keep on developing into a release. </description><author>rgardner</author><pubDate>Wed, 18 Oct 2006 15:05:48 GMT</pubDate><guid isPermaLink="false">Developer Forum: New enhancement request 20061018030548P</guid></item><item><title>User Forum: How to add form like this in the Add New Item dialog?</title><link>http://www.codeplex.com/Project/DisplayThread.aspx?ProjectName=CustomerBorderForm&amp;ForumId=450&amp;ThreadId=1837</link><description>I would like to add/install the skinned form and later i want to have it available from within "Add New Item" dialog(window). 
Could you write down some instructions how this can be acomplished?
Thanks :)</description><author>lulalu</author><pubDate>Sat, 14 Oct 2006 14:19:24 GMT</pubDate><guid isPermaLink="false">User Forum: How to add form like this in the Add New Item dialog? 20061014021924P</guid></item><item><title>Developer Forum: RE: Use project in VB.NET</title><link>http://www.codeplex.com/Project/DisplayThread.aspx?ProjectName=CustomerBorderForm&amp;ForumId=448&amp;ThreadId=1662</link><description>Yes, converting the entire project in VB instead of mixing C# and VB corrected the problem.
I am now experiencing a full "skinable" application!!

Thanks
</description><author>CaptnKebec</author><pubDate>Tue, 03 Oct 2006 22:51:52 GMT</pubDate><guid isPermaLink="false">Developer Forum: RE: Use project in VB.NET 20061003105152P</guid></item></channel></rss>