vurallstar.blogg.se

Mfc edit control getwindowtext
Mfc edit control getwindowtext













For simplicity I just enclose the text in dashes. Anything would be possible here, including the example of converting between hex and dec. The following method gets the original window text and transforms it. Len = DefWindowProcW( WM_GETTEXT, len + 1, reinterpret_cast( text.GetBuffer( len ) ) ) WPARAM = len + 1 because the length must include the null terminator. LRESULT len = DefWindowProcW( WM_GETTEXTLENGTH, 0, 0 ) For this we can directly call the default window procedure which is named DefWindowProc: CStringW CMyEdit::GetTextInternal()

mfc edit control getwindowtext

Add message map entries for WM_GETTEXT and WM_GETTEXTLENGTH to your derived CEdit class: BEGIN_MESSAGE_MAP( CMyEdit, CEdit )Īs we are overriding these messages we need a method of getting the original text of the edit control without going into endless recursion.















Mfc edit control getwindowtext