WndProc没有在C#winform应用程序中调用

时间:2017-02-07 09:52:01

标签: c# winforms

我有一个winform,我正试图在WM_CHAR上做点什么。但是Code没有打破断点。

    public const int WM_IME_ENDCOMPOSITION = 0x0010E;
    public const int WM_IME_COMPOSITION = 0x0010F;
    public const int WM_IME_STARTCOMPOSITION = 0x0010D;
    public const int WM_IME_CHAR = 0x00286;
    public const int WM_CHAR = 0x00102;
    public const int WM_IME_NOTIFY = 0x00282;
    public const int WM_NCLBUTTONDOWN = 0xA1;
    public const int HT_CAPTION = 0x2;
    public const int WM_IME_SETCONTEXT = 0x00281;

    protected override void WndProc(ref Message m)
    {

        switch (m.Msg)
        {

            case WM_IME_CHAR:
                long lParam1 = m.LParam.ToInt64();
                long wParam1 = m.WParam.ToInt64();
                char c1 = (char)m.WParam;
                break;

            case WM_IME_ENDCOMPOSITION:
                long lParam2 = m.LParam.ToInt64();
                long wParam2 = m.WParam.ToInt64();
                char c2 = (char)m.WParam;

                break;

            case 0x00102:
                long lParam3 = m.LParam.ToInt64();
                long wParam3 = m.WParam.ToInt64();
                char c3 = (char)m.WParam;

                break;

            case WM_IME_COMPOSITION:
                long lParam44 = m.LParam.ToInt64();
                long wParam = m.WParam.ToInt64();
                char c4 = (char)m.WParam;
                break;

            default:
                break;
        }

        base.WndProc(ref m);
    }

0 个答案:

没有答案