Bug with WM_MesureItem on Win10 |
Post Reply |
Author | |
Cedric_ar
Groupie Joined: 04 September 2012 Status: Offline Points: 19 |
Post Options
Thanks(0)
Posted: 30 November 2017 at 5:35am |
I'm with 18.2 Version On our application we have a custom popup menu with WM_Mesureitem handler.When we use Skin option on a Win10 pc our handler isn't call anymore because in void CXTPSkinPopupMenu::RecalcItemsSize(CDC *pDC) { ---- if (pItem->IsOwnerDraw()) { if ( XTPSystemVersion()->IsWin10OrGreater() ) { szText = pDC->GetTextExtent( strMenuText ); szText.cx = m_nGripperWidth + szText.cx + XTP_DPI_X( 55 ); szText.cy = max( szText.cy, XTP_DPI_Y( 20 ) ); if ( pItem->IsSeparator() ) { szText.cy = XTP_DPI_Y( IsMenuThemed() ? 6 : 9 ); } } else { MEASUREITEMSTRUCT mis; mis.CtlType = ODT_MENU; mis.CtlID = 0; mis.itemID = pItem->GetID(); mis.itemWidth = 0; mis.itemHeight = (UINT) pDC->GetTextExtent(_T(" "), 1).cy; mis.itemData = pItem->GetItemData(); ::SendMessage(m_hWndNotify, WM_MEASUREITEM, 0, (LPARAM)&mis); szText.cx = mis.itemWidth + XTP_DPI_X(12); szText.cy = mis.itemHeight; } } i changed bold line to if ( XTPSystemVersion()->IsWin10OrGreater() && !strMenuText.isEmpty() ) I don't known if it's a good fix. But know i've my popup menu display correctly. And Popup menu in common dialog works too on win10. ( Broke on older version of Xtreme Toolkit ) regards, Cedric |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |