- Make sure "Open" verb is always inserted first
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Thu, 5 Feb 2009 15:15:24 +0000 (15:15 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Thu, 5 Feb 2009 15:15:24 +0000 (15:15 +0000)
- Apply item style to current item not to next
- bug 4065

svn path=/trunk/; revision=39412

reactos/dll/win32/shell32/shv_def_cmenu.c

index b199e54..4e9294b 100644 (file)
@@ -168,6 +168,16 @@ SH_AddStaticEntry(IDefaultContextMenuImpl * This, WCHAR *szVerb, WCHAR * szClass
             wcscpy(curEntry->szClass, szClass);
     }
 
+    if (!wcsicmp(szVerb, L"open"))
+    {
+        /* open verb is always inserted in front */
+        curEntry->Next = This->shead;
+        This->shead = curEntry;
+        return;
+    }
+
+
+
     if (lastEntry)
     {
         lastEntry->Next = curEntry;
@@ -621,7 +631,7 @@ AddStaticContextMenusToMenu(
     mii.cbSize = sizeof(mii);
     mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_DATA;
     mii.fType = MFT_STRING;
-    mii.fState = MFS_ENABLED | MFS_DEFAULT;
+    mii.fState = MFS_ENABLED;
     mii.wID = 0x4000;
     This->iIdSCMFirst = mii.wID;
 
@@ -684,8 +694,9 @@ AddStaticContextMenusToMenu(
         }
 
         mii.cch = wcslen(mii.dwTypeData);
-        InsertMenuItemW(hMenu, indexMenu++, TRUE, &mii);
         mii.fState = fState;
+        InsertMenuItemW(hMenu, indexMenu++, TRUE, &mii);
+
         mii.wID++;
         curEntry = curEntry->Next;
      }