We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
断点堆栈: void CMenuWnd::ResizeMenu() { CControlUI* pRoot = m_pm.GetRoot();
#if defined(WIN32) && !defined(UNDER_CE) MONITORINFO oMonitor = {}; oMonitor.cbSize = sizeof(oMonitor); ::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTOPRIMARY), &oMonitor); CDuiRect rcWork = oMonitor.rcWork; #else CDuiRect rcWork; GetWindowRect(m_pOwner->GetManager()->GetPaintWindow(), &rcWork); #endif SIZE szAvailable = { rcWork.right - rcWork.left, rcWork.bottom - rcWork.top }; szAvailable = pRoot->EstimateSize(szAvailable); m_pm.SetInitSize(szAvailable.cx, szAvailable.cy);
//必须是Menu标签作为xml的根节点 CMenuUI *pMenuRoot = static_cast<CMenuUI*>(pRoot); ASSERT(pMenuRoot); SIZE szInit = m_pm.GetInitSize(); CDuiRect rc; CDuiPoint point = m_BasedPoint; rc.left = point.x; rc.top = point.y; rc.right = rc.left + szInit.cx; rc.bottom = rc.top + szInit.cy; int nWidth = rc.GetWidth(); int nHeight = rc.GetHeight(); if (m_dwAlignment & eMenuAlignment_Right) { rc.right = point.x; rc.left = rc.right - nWidth; } if (m_dwAlignment & eMenuAlignment_Bottom) { rc.bottom = point.y; rc.top = rc.bottom - nHeight; } m_wndSize.cx = rc.GetWidth(); m_wndSize.cy = rc.GetHeight() + pMenuRoot->GetInset().bottom + pMenuRoot->GetInset().top; SetForegroundWindow(m_hWnd); //运行到这句遇到野指针,不是每次都有,偶尔有碰到 MoveWindow(m_hWnd, rc.left, rc.top, rc.GetWidth(), rc.GetHeight(), FALSE); SetWindowPos(m_hWnd, HWND_TOPMOST, rc.left, rc.top, rc.GetWidth(), m_wndSize.cy, SWP_SHOWWINDOW);
}
LRESULT CALLBACK CShadowUI::ParentProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { .... #pragma warning(disable: 4312) // temporrarily disable the type_cast warning in Win32 // Call the default(original) window procedure for other messages or messages processed but not returned return ((WNDPROC)pThis->m_OriParentProc)(hwnd, uMsg, wParam, lParam); //断在这一句,变量 m_OriParentProc=0,uUmsg=70 #pragma warning(default: 4312) }
The text was updated successfully, but these errors were encountered:
测试未发现此问题
Sorry, something went wrong.
No branches or pull requests
断点堆栈:
void CMenuWnd::ResizeMenu()
{
CControlUI* pRoot = m_pm.GetRoot();
#if defined(WIN32) && !defined(UNDER_CE)
MONITORINFO oMonitor = {};
oMonitor.cbSize = sizeof(oMonitor);
::GetMonitorInfo(::MonitorFromWindow(*this, MONITOR_DEFAULTTOPRIMARY), &oMonitor);
CDuiRect rcWork = oMonitor.rcWork;
#else
CDuiRect rcWork;
GetWindowRect(m_pOwner->GetManager()->GetPaintWindow(), &rcWork);
#endif
SIZE szAvailable = { rcWork.right - rcWork.left, rcWork.bottom - rcWork.top };
szAvailable = pRoot->EstimateSize(szAvailable);
m_pm.SetInitSize(szAvailable.cx, szAvailable.cy);
}
LRESULT CALLBACK CShadowUI::ParentProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
....
#pragma warning(disable: 4312) // temporrarily disable the type_cast warning in Win32
// Call the default(original) window procedure for other messages or messages processed but not returned
return ((WNDPROC)pThis->m_OriParentProc)(hwnd, uMsg, wParam, lParam); //断在这一句,变量 m_OriParentProc=0,uUmsg=70
#pragma warning(default: 4312)
}
The text was updated successfully, but these errors were encountered: