16 Nov 2009 05:53
Cursor/caret is not shown in an in-place CEdit-derived control
I'm converting an MFC application into WTL 8.1 and stuck with issues. The in-place control (see below) is
working only once. If it looses focus and gets the focus back, cursor/caret is no longer visible; however,
content can be changed by typing. Here is declaration of the in-place Edit control:
class CMyInPlaceEdit: public CWindowImpl<CMyInPlaceEdit, CEdit>
{
public:
CMyInPlaceEdit() : CWindowImpl<CMyInPlaceEdit, CEdit>() {}
BOOL SubclassWindow(HWND hWnd)
{
return CWindowImpl<CMyInPlaceEdit, CEdit>::SubclassWindow(hWnd);
}
BEGIN_MSG_MAP_EX(CMyInPlaceEdit)
MESSAGE_HANDLER(WM_KILLFOCUS, OnKillFocus)
MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
<<<cut>>>
};
I create the in-place Edit:
m_edit = new CMyInPlaceEdit();
m_edit->Create(m_parent->m_hWnd, urect, NULL, WS_CHILD | ES_AUTOHSCROLL, 0, MenuOrID, 0);
LRESULT CMyInPlaceEdit::OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
///CEdit::OnLButtonDown(nFlags, point);
::DefWindowProc(m_hWnd, uMsg, wParam, lParam);
bHandled = FALSE;
return 0;
(Continue reading)
RSS Feed