In atlctrls. h, controls are encapsulated.
Add row 1,249th:
void GetMargins(UINT& nLeft, UINT& nRight) const{ATLASSERT(::IsWindow(m_hWnd));DWORD dwRet = (DWORD)::SendMessage(m_hWnd, EM_GETMARGINS, 0, 0L);nLeft = LOWORD(dwRet);nRight = HIWORD(dwRet);}
There is nothing to say. The original function is obtained as a return value:
DWORD GetMargins() const{ATLASSERT(::IsWindow(m_hWnd));return (DWORD)::SendMessage(m_hWnd, EM_GETMARGINS, 0, 0L);}
In row 3, CImageList is changed to a template class, and the beginning of the automatic destruction template is added:
// forward declarationstemplate <bool t_bManaged> class CImageListT;typedef CImageListT<false> CImageList;typedef CImageListT<true> CImageListManaged;template <bool t_bManaged>class CImageListT{public:// Data membersHIMAGELIST m_hImageList;// Constructor/destructor/operatorsCImageListT(HIMAGELIST hImageList = NULL) : m_hImageList(hImageList){ }~CImageListT(){if(t_bManaged && (m_hImageList != NULL))Destroy();}
In row 3, CListViewCtrlT. FindItem adds an overload:
int FindItem(LPCTSTR lpstrFind, bool bPartial = true, bool bWrap = false, int nStart = -1) const{ATLASSERT(::IsWindow(m_hWnd));LVFINDINFO lvfi = { 0 };lvfi.flags = LVFI_STRING | (bWrap ? LVFI_WRAP : 0) | (bPartial ? LVFI_PARTIAL : 0);lvfi.psz = lpstrFind;return (int)::SendMessage(m_hWnd, LVM_FINDITEM, nStart, (LPARAM)&lvfi);}
You do not have to enter the struct when searching for a ListView item.
Row 3, CToolBarCtrlT adds GetItemDropDownRect:
void GetItemDropDownRect(int nIndex, LPRECT lpRect) const{#ifndef TB_GETITEMDROPDOWNRECTconst int TB_GETITEMDROPDOWNRECT = WM_USER + 103;#endifATLASSERT(::IsWindow(m_hWnd));BOOL bRet = (BOOL)::SendMessage(m_hWnd, TB_GETITEMDROPDOWNRECT, nIndex, (LPARAM)lpRect);bRet; // avoid level 4 warningATLASSERT(bRet != FALSE);}
Obtains the size of the window rectangle in the drop-down box on the toolbar. (_ WIN32_WINNT> = 0x0600)
Row 3, CToolBarCtrlT added:
BOOL InsertSeparator(int nIndex, int cxWidth = 8){return InsertButton(nIndex, 0, BTNS_SEP, 0, cxWidth, (INT_PTR)0, 0);}BOOL AddSeparator(int cxWidth = 8){return AddButton(0, BTNS_SEP, 0, cxWidth, (INT_PTR)0, 0);}
Used to add separators on the toolbar.
In row 3, tips in GetToolTips and SetToolTips is changed from lowercase to uppercase Tips .......
In row 3, CTrackBarCtrlT. SetSelStart and the following SetSelEnd and SetSelection Add the bRedraw parameter:
void SetSelStart(int nMin, BOOL bRedraw = FALSE){ATLASSERT(::IsWindow(m_hWnd));::SendMessage(m_hWnd, TBM_SETSELSTART, bRedraw, (LPARAM)nMin);}
In row 3, the macro definition of RichEdit 5 is added:
#if !defined(_UNICODE) && (_RICHEDIT_VER >= 0x0500) #undef MSFTEDIT_CLASS #define MSFTEDIT_CLASS"RICHEDIT50W"#endif
This affects the version of the RichEdit control that CRichEditCtrlT calls.
static LPCTSTR GetLibraryName(){#if (_RICHEDIT_VER >= 0x0500)return _T("MSFTEDIT.DLL");#elif (_RICHEDIT_VER >= 0x0200)return _T("RICHED20.DLL");#elsereturn _T("RICHED32.DLL");#endif}
Add CRichEditCtrlT. GetWordBreakProc and CRichEditCtrlT. SetWordBreakProc:
EDITWORDBREAKPROC GetWordBreakProc() const{ATLASSERT(::IsWindow(m_hWnd));return (EDITWORDBREAKPROC)::SendMessage(m_hWnd, EM_GETWORDBREAKPROC, 0, 0L);}void SetWordBreakProc(EDITWORDBREAKPROC ewbprc){ATLASSERT(::IsWindow(m_hWnd));::SendMessage(m_hWnd, EM_SETWORDBREAKPROC, 0, (LPARAM)ewbprc);}
Line 3: added code for RichEdit 8:
#if (_RICHEDIT_VER >= 0x0800)AutoCorrectProc GetAutoCorrectProc() const{ATLASSERT(::IsWindow(m_hWnd));return (AutoCorrectProc)::SendMessage(m_hWnd, EM_GETAUTOCORRECTPROC, 0, 0L);}BOOL SetAutoCorrectProc(AutoCorrectProc pfn){ATLASSERT(::IsWindow(m_hWnd));return (BOOL)::SendMessage(m_hWnd, EM_SETAUTOCORRECTPROC, (WPARAM)pfn, 0L);}BOOL CallAutoCorrectProc(WCHAR ch){ATLASSERT(::IsWindow(m_hWnd));return (BOOL)::SendMessage(m_hWnd, EM_CALLAUTOCORRECTPROC, (WPARAM)ch, 0L);}DWORD GetEditStyleEx() const{ATLASSERT(::IsWindow(m_hWnd));return (DWORD)::SendMessage(m_hWnd, EM_GETEDITSTYLEEX, 0, 0L);}DWORD SetEditStyleEx(DWORD dwStyleEx, DWORD dwMask){ATLASSERT(::IsWindow(m_hWnd));return (DWORD)::SendMessage(m_hWnd, EM_SETEDITSTYLEEX, dwStyleEx, dwMask);}DWORD GetStoryType(int nStoryIndex) const{ATLASSERT(::IsWindow(m_hWnd));return (DWORD)::SendMessage(m_hWnd, EM_GETSTORYTYPE, nStoryIndex, 0L);}DWORD SetStoryType(int nStoryIndex, DWORD dwStoryType){ATLASSERT(::IsWindow(m_hWnd));return (DWORD)::SendMessage(m_hWnd, EM_SETSTORYTYPE, nStoryIndex, dwStoryType);}DWORD GetEllipsisMode() const{ATLASSERT(::IsWindow(m_hWnd));DWORD dwMode = 0;BOOL bRet = (BOOL)::SendMessage(m_hWnd, EM_GETELLIPSISMODE, 0, (LPARAM)&dwMode);bRet; // avoid level 4 warningATLASSERT(bRet != FALSE);return dwMode;}BOOL SetEllipsisMode(DWORD dwEllipsisMode){ATLASSERT(::IsWindow(m_hWnd));return (BOOL)::SendMessage(m_hWnd, EM_SETELLIPSISMODE, 0, dwEllipsisMode);}BOOL GetEllipsisState() const{ATLASSERT(::IsWindow(m_hWnd));return (BOOL)::SendMessage(m_hWnd, EM_GETELLIPSISSTATE, 0, 0L);}BOOL GetTouchOptions(int nTouchOptions) const{ATLASSERT(::IsWindow(m_hWnd));return (BOOL)::SendMessage(m_hWnd, EM_GETTOUCHOPTIONS, nTouchOptions, 0L);}void SetTouchOptions(int nTouchOptions, BOOL bEnable){ATLASSERT(::IsWindow(m_hWnd));::SendMessage(m_hWnd, EM_SETTOUCHOPTIONS, nTouchOptions, bEnable);}HRESULT InsertTable(TABLEROWPARMS* pRowParams, TABLECELLPARMS* pCellParams){ATLASSERT(::IsWindow(m_hWnd));return (HRESULT)::SendMessage(m_hWnd, EM_INSERTTABLE, (WPARAM)pRowParams, (LPARAM)pCellParams);}HRESULT GetTableParams(TABLEROWPARMS* pRowParams, TABLECELLPARMS* pCellParams) const{ATLASSERT(::IsWindow(m_hWnd));return (HRESULT)::SendMessage(m_hWnd, EM_GETTABLEPARMS, (WPARAM)pRowParams, (LPARAM)pCellParams);}HRESULT SetTableParams(TABLEROWPARMS* pRowParams, TABLECELLPARMS* pCellParams){ATLASSERT(::IsWindow(m_hWnd));return (HRESULT)::SendMessage(m_hWnd, EM_SETTABLEPARMS, (WPARAM)pRowParams, (LPARAM)pCellParams);}HRESULT InsertImage(RICHEDIT_IMAGE_PARAMETERS* pParams){ATLASSERT(::IsWindow(m_hWnd));return (HRESULT)::SendMessage(m_hWnd, EM_INSERTIMAGE, 0, (LPARAM)pParams);}BOOL SetUiaName(LPCTSTR lpstrName){ATLASSERT(::IsWindow(m_hWnd));return (BOOL)::SendMessage(m_hWnd, EM_SETUIANAME, 0, (LPARAM)lpstrName);}#endif // (_RICHEDIT_VER >= 0x0800)
In general, the biggest change in atlctrls. h is CRichEditCtrlT.