I'm trying to figure out an odd issue with the close CXTPTabManagerNavigateButton. We have MDI tabs and we add the close button to the tabs. Sometimes the user has to click the "x" twice to get the window to close.
This is happening only in the V24 CJ toolkit . Comparing V24 to the previous version I have found that there are many more calls to CXTPTabManagerNavigateButton::SetRect where the rectangle passed in is empty. One such case is when the user activates our app (any time the activate message comes in for whatever reason). In V24 hooking code kicks in when I click in one of our document views (or elsewhere or dismiss certain windows that result in that message being sent and processed). I am not seeing this in V23. The empty rect is set by RepostiontablControlEx. The code for that is the same in both versions but it appears this hooking code just keeps making the call in V24:
> ToolkitPro2410vc170x64UD.dll!CXTPTabManagerNavigateButton::SetRect(CRect rcButton) Line 94 C++ ToolkitPro2410vc170x64UD.dll!CXTPTabManagerItem::SetRect(CRect rcItem) Line 311 C++ ToolkitPro2410vc170x64UD.dll!CXTPTabPaintManager::RepositionTabControlEx(CXTPTabManager * pTabManager, CDC * pDC, CRect rcClient) Line 1513 C++ ToolkitPro2410vc170x64UD.dll!CXTPTabPaintManagerTheme::RepositionTabControl(CXTPTabManager * pTabManager, CDC * pDC, CRect rcClient) Line 411 C++ ToolkitPro2410vc170x64UD.dll!CXTPTabPaintManager::RepositionTabControl(CXTPTabManager * pTabManager, CDC * pDC, CRect rcClient) Line 994 C++ ToolkitPro2410vc170x64UD.dll!CXTPTabClientWnd::CalcWindowRect(tagRECT * lpClientRect, unsigned int nAdjustType) Line 1591 C++ jengined.dll!JFrameWnd::RepositionBars(unsigned int nIDFirst, unsigned int nIDLast, unsigned int nIDLeftOver, unsigned int nFlags, tagRECT * lpRectParam, const tagRECT * lpRectClient, int bStretch) Line 15455 C++ jengined.dll!JFrameWnd::RecalcLayout(int bNotify) Line 15761 C++ ToolkitPro2410vc170x64UD.dll!CXTPCommandBars::RecalcFrameLayout(int bDelay) Line 426 C++ ToolkitPro2410vc170x64UD.dll!CXTPCommandBars::RedrawCommandBars() Line 737 C++ ToolkitPro2410vc170x64UD.dll!CXTPCommandBarsFrameHook::OnHookMessage(HWND__ * hWnd, unsigned int nMessage, unsigned __int64 & wParam, __int64 & lParam, __int64 & lResult) Line 1271 C++ ToolkitPro2410vc170x64UD.dll!CXTPHookManager::CHookSink::OnHookMessage(HWND__ * hWnd, unsigned int nMessage, unsigned __int64 & wParam, __int64 & lParam, __int64 & lResult) Line 320 C++ ToolkitPro2410vc170x64UD.dll!CXTPHookManager::HookWndProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 443 C++
Then the rect is left empty until I click on the close item itself in which case a paint message arrives and the V24 code actually sets the rect so it isn't empty. So I click once and a ProcessClick method finds the rect is empty so the check to see if the point is in the rect fails and nothing happens. But a paint soon arrives and the rect is set. So the second click finds the point is in the rect and the window closes.
In V22 of CJ, I have an identical breakpoint set in SetRect that trips only if the rect is empty and that only appears to happen when I first open a document window and the tab control is created. Then the paint occurs and the rect is set and clicking "x" closes the file.
2025 - button is set
to 0,0,0,0 only one time when I open the file and before the tab is drawn.
ToolkitPro2200vc170x64UD.dll!CXTPTabManagerNavigateButton::SetRect(CRect
rcButton) Line 92 C++
ToolkitPro2200vc170x64UD.dll!CXTPTabManagerItem::SetRect(CRect
rcItem) Line 310 C++
ToolkitPro2200vc170x64UD.dll!CXTPTabPaintManager::RepositionTabControlEx(CXTPTabManager
* pTabManager, CDC * pDC, CRect rcClient) Line 1504 C++
ToolkitPro2200vc170x64UD.dll!CXTPTabPaintManagerTheme::RepositionTabControl(CXTPTabManager
* pTabManager, CDC * pDC, CRect rcClient) Line 410 C++
ToolkitPro2200vc170x64UD.dll!CXTPTabPaintManager::RepositionTabControl(CXTPTabManager
* pTabManager, CDC * pDC, CRect rcClient) Line
984 C++
ToolkitPro2200vc170x64UD.dll!CXTPTabClientWnd::CalcWindowRect(tagRECT
* lpClientRect, unsigned int nAdjustType) Line
1557 C++
jengined.dll!JFrameWnd::RepositionBars(unsigned
int nIDFirst, unsigned int nIDLast, unsigned int nIDLeftOver, unsigned int
nFlags, tagRECT * lpRectParam, const tagRECT * lpRectClient, int bStretch) Line
14138 C++
jengined.dll!JFrameWnd::RecalcLayout(int
bNotify) Line 14447 C++
ToolkitPro2200vc170x64UD.dll!CXTPTabClientWnd::Reposition()
Line 2558 C++
ToolkitPro2200vc170x64UD.dll!CXTPTabClientWnd::UpdateContents()
Line 1364 C++
ToolkitPro2200vc170x64UD.dll!CXTPTabClientWnd::OnIdleUpdateCmdUI()
Line 1095 C++
mfc140ud.dll!CWnd::OnWndMsg(unsigned
int message, unsigned __int64 wParam, __int64 lParam, __int64 * pResult) Line
2465 C++
> mfc140ud.dll!CWnd::WindowProc(unsigned
int message, unsigned __int64 wParam, __int64 lParam) Line
2100 C++
ToolkitPro2200vc170x64UD.dll!CXTPTabClientWnd::WindowProc(unsigned
int message, unsigned __int64 wParam, __int64 lParam) Line
2656 C++
mfc140ud.dll!AfxCallWndProc(CWnd
* pWnd, HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64
lParam) Line 265 C++
mfc140ud.dll!CWnd::SendMessageToDescendants(HWND__
* hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam, int
bDeep, int bOnlyPerm) Line 3023 C++
mfc140ud.dll!CWnd::SendMessageToDescendants(unsigned
int message, unsigned __int64 wParam, __int64 lParam, int bDeep, int bOnlyPerm)
Line 129 C++
jengined.dll!JMFCAdapter::IJMainFrameWndImp::OnIdle(long
nCount) Line 4037 C++
jengined.dll!JApplication::UpdateToolBarButtons(int
* pbInPlaceServer) Line 2134 C++
jengined.dll!JApplication::OnIdle(IdleLoopData
& idleLoopData) Line
1371 C++
jengined.dll!ProcessIdleLoop(IdleLoopData
& idleLoopData) Line
4399 C++
Then wm_paint comes
thru and the rect is set:
ToolkitPro2200vc170x64UD.dll!CXTPTabManagerNavigateButton::SetRect(CRect
rcButton) Line 92 C++
ToolkitPro2200vc170x64UD.dll!CXTPTabPaintManager::DrawSingleButtonIconAndText(CDC
* pDC, CXTPTabManagerItem * pItem, CRect rcItem, int bDraw) Line
722 C++
ToolkitPro2200vc170x64UD.dll!CXTPTabThemeVisualStudio2012::DrawSingleButton(CDC
* pDC, CXTPTabManagerItem * pItem) Line
61 C++
ToolkitPro2200vc170x64UD.dll!CXTPTabPaintManager::DrawRowItems(CXTPTabManager
* pTabManager, CDC * pDC, const CRect & rcClipBox, int nItemRow) Line
493 C++
ToolkitPro2200vc170x64UD.dll!CXTPTabPaintManager::DrawTabControlEx(CXTPTabManager
* pTabManager, CDC * pDC, CRect rcClient) Line
547 C++
ToolkitPro2200vc170x64UD.dll!CXTPTabPaintManagerTheme::DrawTabControl(CXTPTabManager
* pTabManager, CDC * pDC, CRect rcControl) Line
404 C++
ToolkitPro2200vc170x64UD.dll!CXTPTabPaintManager::DrawTabControl(CXTPTabManager
* pTabManager, CDC * pDC, CRect rcClient) Line
420 C++
ToolkitPro2200vc170x64UD.dll!CXTPTabClientWnd::CSingleWorkspace::OnPaint()
Line 188 C++
mfc140ud.dll!CWnd::OnWndMsg(unsigned
int message, unsigned __int64 wParam, __int64 lParam, __int64 * pResult) Line
2465 C++
> ToolkitPro2200vc170x64UD.dll!CXTPTabClientWnd::CSingleWorkspace::OnWndMsg(unsigned
int message, unsigned __int64 wParam, __int64 lParam, __int64 * pResult) Line
76 C++
Essentially in V24 that same breakpoint that traps an empty is tripping a lot and even moving the mouse over the tab doesn't cause a paint which would set the correct rect.
So, bug in CJ V24? If so, what is the fix?
|