rem: - itemPtr->rcItem.top, 0, 0);
add: - itemPtr->rcItem.top, 0, drawArrow);
context: TkWinHandleMenuEvent(phwnd, pMessage, pwParam, plParam, plResult)    HWND *phwnd;    UINT *pMessage;    WPARAM *pwParam;    LPARAM *plParam;    LRESULT *plResult;{    Tcl_HashEntry *hashEntryPtr;    int returnResult = 0;    TkMenu *menuPtr;    TkMenuEntry *mePtr;    ThreadSpecificData *tsdPtr = (ThreadSpecificData *)             Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));    switch (*pMessage) {	case WM_INITMENU:	    TkMenuInit();	    hashEntryPtr = Tcl_FindHashEntry(&tsdPtr->winMenuTable,                     (char *) *pwParam);	    if (hashEntryPtr != NULL) {		tsdPtr->oldServiceMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);		menuPtr = (TkMenu *) Tcl_GetHashValue(hashEntryPtr);		tsdPtr->modalMenuPtr = menuPtr;		if (menuPtr->menuFlags & MENU_RECONFIGURE_PENDING) {		    Tcl_CancelIdleCall(ReconfigureWindowsMenu, 			    (ClientData) menuPtr);		    ReconfigureWindowsMenu((ClientData) menuPtr);		}		RecursivelyClearActiveMenu(menuPtr);		if (!tsdPtr->inPostMenu) {		    Tcl_Interp *interp;		    int code;		    interp = menuPtr->interp;		    Tcl_Preserve((ClientData)interp);		    code = TkPreprocessMenu(menuPtr);		    if ((code != TCL_OK) && (code != TCL_CONTINUE)			    && (code != TCL_BREAK)) {			Tcl_AddErrorInfo(interp, "\n    (menu preprocess)");			Tcl_BackgroundError(interp);		    }		    Tcl_Release((ClientData)interp);		}		TkActivateMenuEntry(menuPtr, -1);		*plResult = 0;		returnResult = 1;	    } else {		tsdPtr->modalMenuPtr = NULL;	    }	    break;	case WM_SYSCOMMAND:	case WM_COMMAND: {	    TkMenuInit();	    if (HIWORD(*pwParam) != 0) {		break;	    }	    hashEntryPtr = Tcl_FindHashEntry(&tsdPtr->commandTable,		    (char *)LOWORD(*pwParam));	    if (hashEntryPtr == NULL) {		break;	    }	    mePtr = (TkMenuEntry *) Tcl_GetHashValue(hashEntryPtr);	    if (mePtr != NULL) {		TkMenuReferences *menuRefPtr;		TkMenuEntry *parentEntryPtr;		Tcl_Interp *interp;		int code;		/*		 * We have to set the parent of this menu to be active		 * if this is a submenu so that tearoffs will get the		 * correct title.		 */		menuPtr = mePtr->menuPtr;		menuRefPtr = TkFindMenuReferences(menuPtr->interp,			Tk_PathName(menuPtr->tkwin));		if ((menuRefPtr != NULL)			&& (menuRefPtr->parentEntryPtr != NULL)) {		    char *name;		    for (parentEntryPtr = menuRefPtr->parentEntryPtr;			 ; 			 parentEntryPtr = 			     parentEntryPtr->nextCascadePtr) {			name = Tcl_GetStringFromObj(			    parentEntryPtr->namePtr, NULL);			if (strcmp(name, Tk_PathName(menuPtr->tkwin))				== 0) {			    break;			}		    }		    if (parentEntryPtr->menuPtr->entries[parentEntryPtr->index]			    ->state != ENTRY_DISABLED) {			TkActivateMenuEntry(parentEntryPtr->menuPtr, 				parentEntryPtr->index);		    }		}		interp = menuPtr->interp;		Tcl_Preserve((ClientData)interp);		code = TkInvokeMenu(interp, menuPtr, mePtr->index);		if (code != TCL_OK && code != TCL_CONTINUE			&& code != TCL_BREAK) {		    Tcl_AddErrorInfo(interp, "\n    (menu invoke)");		    Tcl_BackgroundError(interp);		}		Tcl_Release((ClientData)interp);	    }	    *plResult = 0;	    returnResult = 1;	    break;	}	case WM_MENUCHAR: {	    unsigned char menuChar = (unsigned char) LOWORD(*pwParam);	    hashEntryPtr = Tcl_FindHashEntry(&tsdPtr->winMenuTable,                     (char *) *plParam);	    if (hashEntryPtr != NULL) {		int i;		*plResult = 0;		menuPtr = (TkMenu *) Tcl_GetHashValue(hashEntryPtr);		for (i = 0; i < menuPtr->numEntries; i++) {		    int underline;		    char *label;		    underline = menuPtr->entries[i]->underline;		    if (menuPtr->entries[i]->labelPtr != NULL) {			label = Tcl_GetStringFromObj(				menuPtr->entries[i]->labelPtr, NULL);		    }		    if ((-1 != underline) 			    && (NULL != menuPtr->entries[i]->labelPtr)			    && (CharUpper((LPTSTR) menuChar) 			    == CharUpper((LPTSTR) (unsigned char) 			    label[underline]))) {			*plResult = (2 << 16) | i;			returnResult = 1;			break;		    }		}	    }	    break;	}	case WM_MEASUREITEM: {	    LPMEASUREITEMSTRUCT itemPtr = (LPMEASUREITEMSTRUCT) *plParam;    	    if (itemPtr != NULL) {		mePtr = (TkMenuEntry *) itemPtr->itemData;		menuPtr = mePtr->menuPtr;		TkRecomputeMenu(menuPtr);		itemPtr->itemHeight = mePtr->height;		itemPtr->itemWidth = mePtr->width;		if (mePtr->hideMargin) {		    itemPtr->itemWidth += 2 - indicatorDimensions[1];		} else {		    int activeBorderWidth;		    		    Tk_GetPixelsFromObj(menuPtr->interp, menuPtr->tkwin,			    menuPtr->activeBorderWidthPtr, 			    &activeBorderWidth);		    itemPtr->itemWidth += 2 * activeBorderWidth;		}		*plResult = 1;		returnResult = 1;	    }	    break;	}		case WM_DRAWITEM: {	    TkWinDrawable *twdPtr;	    LPDRAWITEMSTRUCT itemPtr = (LPDRAWITEMSTRUCT) *plParam;	    Tk_FontMetrics fontMetrics;	    if (itemPtr != NULL) {		Tk_Font tkfont;		mePtr = (TkMenuEntry *) itemPtr->itemData;		menuPtr = mePtr->menuPtr;		twdPtr = (TkWinDrawable *) ckalloc(sizeof(TkWinDrawable));		twdPtr->type = TWD_WINDC;		twdPtr->winDC.hdc = itemPtr->hDC;		if (mePtr->state != ENTRY_DISABLED) {		    if (itemPtr->itemState & ODS_SELECTED) {			TkActivateMenuEntry(menuPtr, mePtr->index);		    } else {			TkActivateMenuEntry(menuPtr, -1);		    }		} else {		    /* On windows, menu entries should highlight even if they		    ** are disabled. (I know this seems dumb, but it is the way		    ** native windows menus works so we ought to mimic it.)		    ** The ENTRY_PLATFORM_FLAG1 flag will indicate that the		    ** entry should be highlighted even though it is disabled.		    */		    if (itemPtr->itemState & ODS_SELECTED) {			mePtr->entryFlags |= ENTRY_PLATFORM_FLAG1;		    } else {			mePtr->entryFlags &= ~ENTRY_PLATFORM_FLAG1;		    }		}		tkfont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr);		Tk_GetFontMetrics(tkfont, &fontMetrics);		TkpDrawMenuEntry(mePtr, (Drawable) twdPtr, tkfont,			&fontMetrics, itemPtr->rcItem.left,			itemPtr->rcItem.top, itemPtr->rcItem.right			- itemPtr->rcItem.left, itemPtr->rcItem.bottom			- itemPtr->rcItem.top, 0, 0);		ckfree((char *) twdPtr);		*plResult = 1;		returnResult = 1;	    }	    break;	}	case WM_MENUSELECT: {	    UINT flags = HIWORD(*pwParam);	    TkMenuInit();	    if ((flags == 0xFFFF) && (*plParam == 0)) {		Tcl_SetServiceMode(tsdPtr->oldServiceMode);		if (tsdPtr->modalMenuPtr != NULL) {		    RecursivelyClearActiveMenu(tsdPtr->modalMenuPtr);		}	    } else {		menuPtr = NULL; 		if (*plParam != 0) {		    hashEntryPtr = Tcl_FindHashEntry(&tsdPtr->winMenuTable,			    (char *) *plParam);		    if (hashEntryPtr != NULL) {			menuPtr = (TkMenu *) Tcl_GetHashValue(hashEntryPtr);		    }		}		if (menuPtr != NULL) {	    	    mePtr = NULL;		    if (flags != 0xFFFF) {			if (flags & MF_POPUP) {			    mePtr = menuPtr->entries[LOWORD(*pwParam)];			} else {			    hashEntryPtr = Tcl_FindHashEntry(                                    &tsdPtr->commandTable,				    (char *) LOWORD(*pwParam));			    if (hashEntryPtr != NULL) {				mePtr = (TkMenuEntry *) 					Tcl_GetHashValue(hashEntryPtr);			    }			}		    }	 		    if ((mePtr == NULL) || (mePtr->state == ENTRY_DISABLED)) {			TkActivateMenuEntry(menuPtr, -1);		    } else {			TkActivateMenuEntry(menuPtr, mePtr->index);		    }		    MenuSelectEvent(menuPtr);		    Tcl_ServiceAll();		}	    }	    break;	}    }    return returnResult;}