AnotherUser
AnotherUser

Reputation: 1353

WndProc override odd message, cant be proper

I am looking at the code posted here, specifically SyntaxRichTextBox.cs at the overriden method WndProc.

Is this just a typo in the code? What windows msg is 0x00f? Did they mean 0x0f for WM_PAINT? And what is the author of the code catching that message?

Code:

protected override void WndProc(ref System.Windows.Forms.Message m)
{
    if (m.Msg == 0x00f)
    {
        if (m_bPaint)
            base.WndProc(ref m);
        else
            m.Result = IntPtr.Zero;
    }
    else
        base.WndProc(ref m);
}

Upvotes: 1

Views: 1155

Answers (1)

vhallac
vhallac

Reputation: 13917

First off, as James McNellis suggested in the comment above, 0x00f and 0x0f indicate the same number. I didn't check the value of WM_PAINT message, but the code looks like it is handling this message.

It looks like a simple optimization: if m_bPaint is false, skip the base.WndProc() call. Probably m_bPaint is a flag that indicates there is something that needs to be redrawn.

Upvotes: 2

Related Questions