Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - Bug with WM_MesureItem on Win10
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Bug with WM_MesureItem on Win10

 Post Reply Post Reply
Author
Message
Cedric_ar View Drop Down
Groupie
Groupie


Joined: 04 September 2012
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cedric_ar Quote  Post ReplyReply Direct Link To This Post Topic: Bug with WM_MesureItem on Win10
    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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.