Hiding caret in RichEdit winapi

廉价感情. 提交于 2019-12-07 15:30:38

Here is the solution:

LRESULT CALLBACK ChatMessaegsSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    LRESULT ret = CallWindowProc(WndProc_ChatMessages, hwnd, msg, wParam, lParam);
    switch(msg)
    {
    case WM_LBUTTONDOWN:
    {
        HideCaret(ChatMessages);
        break;
    }
    case WM_KILLFOCUS:
    {
        ShowCaret(ChatMessages);
        break;
    }
    }
    return ret;
}

NOTE this only works when user induces the focus with mouse. Therefore if anyone knows how to deal with it correctly, feel free to answer, I'll be glad.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!