Author: janderwald
Date: Mon Nov 3 15:44:34 2008
New Revision: 37177
URL:
http://svn.reactos.org/svn/reactos?rev=37177&view=rev
Log:
- Check if IContextMenu_InvokeCommand succeeded
- Pass the identifiers of string as id to _InsertMenuItem function
- Should fix invoking control panel items
Modified:
trunk/reactos/dll/win32/shell32/shfldr_cpanel.c
trunk/reactos/dll/win32/shell32/shlview.c
Modified: trunk/reactos/dll/win32/shell32/shfldr_cpanel.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shfldr_c…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shfldr_cpanel.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shfldr_cpanel.c [iso-8859-1] Mon Nov 3 15:44:34 2008
@@ -1212,7 +1212,7 @@
if (LoadStringW(shell32_hInstance, IDS_OPEN, szBuffer,
sizeof(szBuffer)/sizeof(WCHAR)))
{
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
- _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING,
szBuffer, MFS_DEFAULT);
+ _InsertMenuItemW(hMenu, indexMenu++, TRUE, IDS_OPEN, MFT_STRING, szBuffer,
MFS_DEFAULT); //FIXME identifier
Count++;
}
@@ -1224,7 +1224,7 @@
}
szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
- _InsertMenuItemW(hMenu, indexMenu++, TRUE, idCmdFirst + Count, MFT_STRING,
szBuffer, MFS_ENABLED);
+ _InsertMenuItemW(hMenu, indexMenu++, TRUE, IDS_CREATELINK, MFT_STRING, szBuffer,
MFS_ENABLED); //FIXME identifier
Count++;
}
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, Count);
@@ -1251,7 +1251,7 @@
TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",This,lpcmi,lpcmi->lpVerb,
lpcmi->hwnd);
- if (lpcmi->lpVerb == MAKEINTRESOURCEA(1))
+ if (lpcmi->lpVerb == MAKEINTRESOURCEA(IDS_OPEN)) //FIXME
{
ZeroMemory(&sei, sizeof(sei));
sei.cbSize = sizeof(sei);
@@ -1264,7 +1264,7 @@
if (sei.hInstApp <= (HINSTANCE)32)
return E_FAIL;
}
- else if (lpcmi->lpVerb == MAKEINTRESOURCEA(2))
+ else if (lpcmi->lpVerb == MAKEINTRESOURCEA(IDS_CREATELINK)) //FIXME
{
if (!SHGetSpecialFolderPathW(NULL, szPath, CSIDL_DESKTOPDIRECTORY, FALSE))
return E_FAIL;
Modified: trunk/reactos/dll/win32/shell32/shlview.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlview.…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shlview.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shlview.c [iso-8859-1] Mon Nov 3 15:44:34 2008
@@ -887,10 +887,12 @@
ici.lpVerb = MAKEINTRESOURCEA( def );
ici.hwnd = This->hWnd;
- IContextMenu_InvokeCommand(cm, (LPCMINVOKECOMMANDINFO) &ici );
- IContextMenu_Release(cm);
- DestroyMenu( hmenu );
- return S_OK;
+ if (IContextMenu_InvokeCommand(cm, (LPCMINVOKECOMMANDINFO) &ici ) == S_OK)
+ {
+ IContextMenu_Release(cm);
+ DestroyMenu( hmenu );
+ return S_OK;
+ }
}
}