Print Page | Close Window

Bug with WM_MesureItem on Win10

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=23514
Printed Date: 21 November 2024 at 12:56pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Bug with WM_MesureItem on Win10
Posted By: Cedric_ar
Subject: Bug with WM_MesureItem on Win10
Date 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




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net