Commit efaa068c authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Always pass 0 as item id for WM_MEASUREITEM in menus.

parent 33ba7c07
...@@ -822,7 +822,7 @@ static void MENU_GetBitmapItemSize( MENUITEM *lpitem, SIZE *size, ...@@ -822,7 +822,7 @@ static void MENU_GetBitmapItemSize( MENUITEM *lpitem, SIZE *size,
measItem.itemWidth = lpitem->rect.right - lpitem->rect.left; measItem.itemWidth = lpitem->rect.right - lpitem->rect.left;
measItem.itemHeight = lpitem->rect.bottom - lpitem->rect.top; measItem.itemHeight = lpitem->rect.bottom - lpitem->rect.top;
measItem.itemData = lpitem->dwItemData; measItem.itemData = lpitem->dwItemData;
SendMessageW( hwndOwner, WM_MEASUREITEM, lpitem->wID, (LPARAM)&measItem); SendMessageW( hwndOwner, WM_MEASUREITEM, 0, (LPARAM)&measItem);
size->cx = measItem.itemWidth; size->cx = measItem.itemWidth;
size->cy = measItem.itemHeight; size->cy = measItem.itemHeight;
return; return;
......
...@@ -169,6 +169,8 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg, ...@@ -169,6 +169,8 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg,
if( winetest_debug) if( winetest_debug)
trace("WM_MEASUREITEM received data %lx size %dx%d\n", trace("WM_MEASUREITEM received data %lx size %dx%d\n",
pmis->itemData, pmis->itemWidth, pmis->itemHeight); pmis->itemData, pmis->itemWidth, pmis->itemHeight);
ok( !wparam, "wrong wparam %lx\n", wparam );
ok( pmis->CtlType == ODT_MENU, "wrong type %x\n", pmis->CtlType );
MOD_odheight = pmis->itemHeight; MOD_odheight = pmis->itemHeight;
pmis->itemWidth = MODsizes[pmis->itemData].cx; pmis->itemWidth = MODsizes[pmis->itemData].cx;
pmis->itemHeight = MODsizes[pmis->itemData].cy; pmis->itemHeight = MODsizes[pmis->itemData].cy;
...@@ -197,6 +199,8 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg, ...@@ -197,6 +199,8 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg,
pdis->rcItem.right,pdis->rcItem.bottom ); pdis->rcItem.right,pdis->rcItem.bottom );
SelectObject( pdis->hDC, oldpen); SelectObject( pdis->hDC, oldpen);
} }
ok( !wparam, "wrong wparam %lx\n", wparam );
ok( pdis->CtlType == ODT_MENU, "wrong type %x\n", pdis->CtlType );
/* calculate widths of some menu texts */ /* calculate widths of some menu texts */
if( ! MOD_txtsizes[0].size.cx) if( ! MOD_txtsizes[0].size.cx)
for(i = 0; MOD_txtsizes[i].text; i++) { for(i = 0; MOD_txtsizes[i].text; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment