- align magic buttons right
- shortcuts alignment working again

diff --git a/controls/menu.c b/controls/menu.c
index 19748d5..793e10b 100644
--- a/controls/menu.c
+++ b/controls/menu.c
@@ -221,7 +221,7 @@
 	    MENUFLAG(MFT_RADIOCHECK, "radio");
 	    MENUFLAG(MFT_RIGHTORDER, "rorder");
 	    MENUFLAG(MF_SYSMENU, "sys");
-	    MENUFLAG(MFT_RIGHTJUSTIFY, "right");
+	    MENUFLAG(MFT_RIGHTJUSTIFY, "right");	/* same as MF_HELP */
 
 	    if (flags)
 		dsprintf(menu, "+0x%x", flags);
@@ -672,7 +672,7 @@
      * bitmap buttons are pressed/selected/released.
      */
 
-    switch(id)
+    switch(id & 0xffff)
     {   case HBMMENU_SYSTEM:
 	    return (dwItemData) ?
 		(HBITMAP)dwItemData :
@@ -928,21 +928,20 @@
     lprect->bottom = maxY;
     lppop->Height = lprect->bottom - lprect->top;
 
-      /* Flush right all items between the MF_HELP and the last item */
-      /* (if several lines, only move the last line) */
-    if (helpPos != -1)
+    /* Flush right all magic items and items between the MF_HELP and */
+    /* the last item (if several lines, only move the last line) */
+    lpitem = &lppop->items[lppop->nItems-1];
+    orgY = lpitem->rect.top;
+    orgX = lprect->right;
+    for (i = lppop->nItems - 1; i >= helpPos; i--, lpitem--)
     {
-	lpitem = &lppop->items[lppop->nItems-1];
-	orgY = lpitem->rect.top;
-	orgX = lprect->right;
-	for (i = lppop->nItems - 1; i >= helpPos; i--, lpitem--)
-	{
-	    if (lpitem->rect.top != orgY) break;    /* Other line */
-	    if (lpitem->rect.right >= orgX) break;  /* Too far right already */
-	    lpitem->rect.left += orgX - lpitem->rect.right;
-	    lpitem->rect.right = orgX;
-	    orgX = lpitem->rect.left;
-	}
+	if ( !IS_BITMAP_ITEM(lpitem->fType) && ((helpPos ==-1) ? TRUE : (helpPos>i) ))
+	    break;				/* done */
+	if (lpitem->rect.top != orgY) break;	/* Other line */
+	if (lpitem->rect.right >= orgX) break;	/* Too far right already */
+	lpitem->rect.left += orgX - lpitem->rect.right;
+	lpitem->rect.right = orgX;
+	orgX = lpitem->rect.left;
     }
 }
 
@@ -1215,9 +1214,14 @@
 	    if (lpitem->text[i] == '\t')
 	    {
 		rect.left = lpitem->xTab;
-		DrawTextA( hdc, lpitem->text + i + 1, -1, &rect, uFormat );
+		uFormat = DT_LEFT | DT_VCENTER | DT_SINGLELINE;
 	    }
-	    else DrawTextA( hdc, lpitem->text + i + 1, -1, &rect, uFormat );
+	    else 
+	    {
+		uFormat = DT_RIGHT | DT_VCENTER | DT_SINGLELINE;
+	    }
+
+	    DrawTextA( hdc, lpitem->text + i + 1, -1, &rect, uFormat );
 	}
     }
 }