How to Paint NonClient Area

András Mocsáry <[email protected]>
Newsgroups gmane.comp.gnome.winforms
Message-ID <[email protected]>
I'd like to ask for help on how to paint the nonclient area under mono using
winforms.

I've read that mono emulates the msg codes like WM_NCPAINT, thus I wrote:

        protected override void WndProc(ref Message m)
        {
            base.WndProc(ref m);
            //WM_NCPAINT =0x0085
            if (m.Msg == 0x0085)//nonclient paint
            {
                Graphics g = Graphics.FromHwndInternal(this.Handle);
                g.DrawImage(BeautyButtons.Properties.Resources.btnBorder4,
0, 0);
            }
        }
But does not works.

Under widnows I used:
                IntPtr pTarget = GetWindowDC(targetHandle);
                Graphics thisGraph = Graphics.FromHdc(pTarget);
                //Top
                thisGraph.DrawImage(sourceBitmap, 0, 0, wdth,
titleBarheight);
                ...
                ReleaseDC(targetHandle, pTarget);
Note that under windows it can be pointed to any other window. For the
project that's not necessary.
On the contrary, it would be best if a purely managed solution would exists,
which would run under most mono platforms.

Thx for your advice

Andrew

_______________________________________________
Mono-winforms-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-winforms-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.