| ||
(IsWinXPAndLater() ? CS_DROPSHADOW : 0), StartWindowProc, 0, 0, NULL, NULL, NULL, (HBRUSH)(COLOR_WINDOW + 1), NULL, NULL, NULL }, NULL, NULL, IDC_ARROW, TRUE, 0, _T("") }; return wc; } public: CBkDialogImpl(UINT uResID = 0) : m_uResID(uResID) , m_bShowWindow(TRUE) , m_bExitModalLoop(FALSE) { } virtual ~CBkDialogImpl() { } protected: typedef CBkDialogImpl<T, TBkView, TBase, TWinTraits> __thisClass; UINT m_uResID; UINT m_uRetCode; TBkView m_richView; BOOL m_bShowWindow; void ResizeClient(SIZE sizeClient, BOOL bRedraw) { ResizeClient(sizeClient.cx, sizeClient.cy, bRedraw); } void ResizeClient(int cx, int cy, BOOL bRedraw) { CRect rcWindow, rcClient; CPoint ptWindow; GetWindowRect(rcWindow); GetClientRect(rcClient); ptWindow = rcWindow.TopLeft(); rcWindow.MoveToXY(0, 0); rcWindow -= rcClient; rcClient.SetRect(0, 0, cx, cy); rcWindow += rcClient; rcWindow.MoveToXY(ptWindow); MoveWindow(rcWindow, bRedraw); } void OnSize(UINT nType, CSize size) { CRect rcClient; GetClientRect(rcClient); if (SIZE_MINIMIZED != nType) { if (m_richView.m_hWnd) m_richView.MoveWindow(rcClient); } SetMsgHandled(FALSE); } BOOL OnEraseBkgnd(CDCHandle dc) { return TRUE; } LRESULT OnNcCalcSize(BOOL bCalcValidRects, LPARAM lParam) { if (bCalcValidRects) { CRect rcWindow; GetWindowRect(rcWindow); LPNCCALCSIZE_PARAMS pParam = (LPNCCALCSIZE_PARAMS)lParam; if (SWP_NOSIZE == (SWP_NOSIZE & pParam->lppos->flags)) return 0; if (0 == (SWP_NOMOVE & pParam->lppos->flags)) { rcWindow.left = pParam->lppos->x; rcWindow.top = pParam->lppos->y; } rcWindow.right = rcWindow.left + pParam->lppos->cx; rcWindow.bottom = rcWindow.top + pParam->lppos->cy; pParam->rgrc[0] = rcWindow; pParam->rgrc[1] = pParam->rgrc[0]; } return 0; } void OnGetMinMaxInfo(LPMINMAXINFO lpMMI) { HMONITOR hMonitor = ::MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONULL); if (hMonitor) { MONITORINFO mi = {sizeof(MONITORINFO)}; ::GetMonitorInfo(hMonitor, &mi); CRect rcWork = mi.rcWork, rcMonitor = mi.rcMonitor; lpMMI->ptMaxPosition.x = abs(rcWork.left - rcMonitor.left) - 1; lpMMI->ptMaxPosition.y = abs(rcWork.top - rcMonitor.top) - 1; lpMMI->ptMaxSize.x = abs(rcWork.Width()) + 2; lpMMI->ptMaxSize.y = abs(rcWork.Height()) + 2; lpMMI->ptMaxTrackSize.x = abs(rcWork.Width()) + 2; lpMMI->ptMaxTrackSize.y = abs(rcWork.Height()) + 2; } } BOOL OnNcActivate(BOOL bActive) { return TRUE; } public: BOOL Load(UINT uResID) { CStringA strXml; BOOL bRet = BkResManager::LoadResource(uResID, strXml); if (!bRet) return FALSE; return SetXml(strXml); } BOOL SetXml(LPCSTR lpszXml) { return m_richView.SetXml(lpszXml); } HWND GetViewHWND() { return m_richView.m_hWnd; } BOOL SetPanelXml(UINT uItemID, UINT uResID) { return m_richView.SetPanelXml(uItemID, uResID); } BOOL SetPanelXml(UINT uItemID, LPCSTR lpszXml) { return m_richView.SetPanelXml(uItemID, lpszXml); } BOOL SetRichText(UINT uItemID, UINT uResID) { return m_richView.SetRichText(uItemID, uResID); } BOOL FormatRichText(UINT uItemID, LPCTSTR lpszFormat, ...) { va_list args; CString strText; va_start(args, lpszFormat); strText.FormatV(lpszFormat, args); return m_richView.SetRichText(uItemID, strText); } BOOL SetRichText(UINT uItemID, LPCWSTR lpszXml) { return m_richView.SetRichText(uItemID, lpszXml); } BOOL SetRichText(UINT uItemID, LPCSTR lpszXml) { return m_richView.SetRichText(uItemID, lpszXml); } BOOL SetItemText(UINT uItemID, LPCTSTR lpszText) { return m_richView.SetItemText(uItemID, lpszText); } CString GetItemText(UINT uItemID) { return m_richView.GetItemText(uItemID); } BOOL FormatItemText(UINT uItemID, LPCTSTR lpszFormat, ...) { va_list args; CString strText; va_start(args, lpszFormat); strText.FormatV(lpszFormat, args); return m_richView.SetItemText(uItemID, strText); } BOOL SetItemAttribute(UINT uItemID, LPCSTR lpszAttrib, LPCSTR lpszValue) { return m_richView.SetItemAttribute(uItemID, lpszAttrib, lpszValue); } BOOL GetItemRect(UINT uItemID, RECT &rcItem) { return m_richView.GetItemRect(uItemID, rcItem); } BOOL SetItemStringAttribute(UINT uItemID, LPCSTR lpszAttrib, LPCTSTR lpszValue) { return m_richView.SetItemStringAttribute(uItemID, lpszAttrib, lpszValue); } BOOL SetItemIntAttribute(UINT uItemID, LPCSTR lpszAttrib, int nValue) { return m_richView.SetItemIntAttribute(uItemID, lpszAttrib, nValue); } BOOL SetItemDWordAttribute(UINT uItemID, LPCSTR lpszAttrib, DWORD dwValue) { return m_richView.SetItemDWordAttribute(uItemID, lpszAttrib, dwValue); } BOOL SetItemColorAttribute(UINT uItemID, LPCSTR lpszAttrib, COLORREF crValue) { return m_richView.SetItemColorAttribute(uItemID, lpszAttrib, crValue); } BOOL GetItemCheck(UINT uItemID) { return m_richView.GetItemCheck(uItemID); } BOOL SetItemCheck(UINT uItemID, BOOL bCheck) { return m_richView.SetItemCheck(uItemID, bCheck); } BOOL IsItemEnable(UINT uItemID, BOOL bCheckParent = FALSE) { return m_richView.IsItemEnable(uItemID, bCheckParent); } BOOL EnableItem(UINT uItemID, BOOL bEnable) { return m_richView.EnableItem(uItemID, bEnable); } BOOL IsItemVisible(UINT uItemID, BOOL bCheckParent = FALSE) { return m_richView.IsItemVisible(uItemID, bCheckParent); } BOOL SetItemVisible(UINT uItemID, BOOL bVisible) { return m_richView.SetItemVisible(uItemID, bVisible); } BOOL SetTabCurSel(UINT uItemID, int nPage) { return m_richView.SetTabCurSel(uItemID, nPage); } int GetTabCurSel(UINT uItemID) { return m_richView.GetTabCurSel(uItemID); } BOOL SetTabTitle(UINT uItemID, int nPage, LPCTSTR lpszTitle) { return m_richView.SetTabTitle(uItemID, nPage, lpszTitle); } BOOL IsTabPageVisible(UINT uItemID, int nPage) { return m_richView.IsTabPageVisible(uItemID, nPage); } BOOL SetTabPageVisible(UINT uItemID, int nPage, BOOL bVisible) { return m_richView.SetTabPageVisible(uItemID, nPage, bVisible); } BOOL SetItemIconHandle(UINT uItemID, HICON hIcon) { return m_richView.SetItemIconHandle(uItemID, hIcon); } BOOL SetItemPaintHook(UINT uItemID, IBkWindowPaintHook* lpPaintHook) { return m_richView.SetItemPaintHook(uItemID, lpPaintHook); } void SetWindowCaption(LPCTSTR lpszCaption) { m_richView.SetWindowCaption(lpszCaption); } // Call at WM_INITDIALOG void DontShowWindow() { m_bShowWindow = FALSE; } <span style="color:#cc0000;"> HWND Create(HWND hWndParent = ::GetActiveWindow(), LPRECT rect = NULL) { </span> if (!m_richView.XmlLoaded()) { if (0 == m_uResID 软件下载: (网视站,专业提供浏览器下载) | ||
相关文章相关软件2345安全卫士最新官方版2345安全卫士官方版 | 45.34MB 360杀毒软件官方正式版360杀毒软件官方正式版 | 35.10MB 360安全卫士最新版下载360安全卫士最新版下载 | 50.3MB QQ电脑管家官方正式版QQ电脑管家官方正式版 | 24.2MB 金山毒霸2022最新版下载金山毒霸2022下载 | 37MB 猎豹清理大师官方版下载猎豹清理大师下载 | 47.4MB |