Author: janderwald
Date: Tue Dec 4 02:33:36 2007
New Revision: 30992
URL:
http://svn.reactos.org/svn/reactos?rev=30992&view=rev
Log:
- show nice display name when full path for executable is available
- enumerate default open verb too
- look in HKCR progid for default verbs/file associations
- fix a bug in SHEOW_LoadOpenWithItems
Modified:
trunk/reactos/dll/win32/shell32/she_ocmenu.c
Modified: trunk/reactos/dll/win32/shell32/she_ocmenu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/she_ocme…
==============================================================================
--- trunk/reactos/dll/win32/shell32/she_ocmenu.c (original)
+++ trunk/reactos/dll/win32/shell32/she_ocmenu.c Tue Dec 4 02:33:36 2007
@@ -164,6 +164,7 @@
MENUITEMINFOW mii;
WCHAR szBuffer[MAX_PATH];
UINT index;
+ WCHAR * szPtr;
static const WCHAR szChoose[] = {
'C','h','o','o','s','e','
','P','r','o','g','r','a','m','.','.','.',0
};
ZeroMemory(&mii, sizeof(mii));
@@ -175,7 +176,26 @@
for (index = 0; index < This->count; index++)
{
mii.wID = idCmdFirst;
- mii.dwTypeData = (LPWSTR)This->szArray[index];
+ szPtr = wcsrchr(This->szArray[index], L'\\');
+ if (!szPtr)
+ {
+ szPtr = This->szArray[index];
+ }
+ else
+ {
+ /* remove backslash from path */
+ szPtr++;
+ }
+
+ wcscpy(szBuffer, szPtr);
+ szPtr = wcsrchr(szBuffer, L'.');
+ if (szPtr)
+ {
+ /* remove .exe part from display list */
+ szPtr[0] = 0;
+ }
+
+ mii.dwTypeData = szBuffer;
if (InsertMenuItemW(hMenu, -1, TRUE, &mii))
{
idCmdFirst++;
@@ -1013,6 +1033,31 @@
return NumKeys;
result = RegOpenKeyExW(hKey,
+ L"shell\\open\\command",
+ 0,
+ KEY_READ | KEY_QUERY_VALUE,
+ &hSubKey);
+
+ if (result == ERROR_SUCCESS)
+ {
+ WCHAR szBuffer[MAX_PATH+10];
+ WCHAR * ptr;
+ DWORD dwBuffer = sizeof(szBuffer);
+
+ if (RegGetValueW(hSubKey, NULL, NULL, RRF_RT_REG_SZ, NULL, (PVOID)szBuffer,
&dwBuffer) == ERROR_SUCCESS)
+ {
+ ptr = wcsrchr(szBuffer, L' ');
+ if (ptr)
+ {
+ /* erase %1 or extra arguments */
+ ptr[0] = 0;
+ }
+ SHEOW_AddOWItem(This, szBuffer);
+ }
+ RegCloseKey(hSubKey);
+ }
+
+ result = RegOpenKeyExW(hKey,
szCROW,
0,
KEY_READ | KEY_QUERY_VALUE,
@@ -1196,13 +1241,17 @@
}
SHEOW_LoadItemFromHKCU(This, szPtr);
+ if (RegGetValueW(HKEY_CURRENT_USER, szPtr, NULL, RRF_RT_REG_SZ, NULL, szPath,
&dwPath) == ERROR_SUCCESS)
+ {
+ SHEOW_LoadItemFromHKCU(This, szPath);
+ }
+
SHEOW_LoadItemFromHKCR(This, szPtr);
dwPath = sizeof(szPath);
if (RegGetValueW(HKEY_CLASSES_ROOT, szPtr, NULL, RRF_RT_REG_SZ, NULL, szPath,
&dwPath) == ERROR_SUCCESS)
{
- SHEOW_LoadItemFromHKCU(This, szPath);
- }
-
+ SHEOW_LoadItemFromHKCR(This, szPath);
+ }
}
TRACE("count %u\n", This->count);
return S_OK;