#define IDS_HELP_COMPARESAVED 109
#define IDS_RESELECT_FIRST 110
#define IDB_WINMERGE 202
+#define IDB_WINMERGEDIR 203
+#define IDB_WINMERGEPARENT 204
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 203
+#define _APS_NEXT_RESOURCE_VALUE 205
#define _APS_NEXT_COMMAND_VALUE 32768
#define _APS_NEXT_CONTROL_VALUE 201
#define _APS_NEXT_SYMED_VALUE 111
//\r
\r
VS_VERSION_INFO VERSIONINFO\r
- FILEVERSION 1,15,0,3\r
- PRODUCTVERSION 1,15,0,3\r
+ FILEVERSION 1,15,0,4\r
+ PRODUCTVERSION 1,15,0,4\r
FILEFLAGSMASK 0x3fL\r
#ifdef _DEBUG\r
FILEFLAGS 0x1L\r
VALUE "Comments", "\0"\r
VALUE "CompanyName", "http://winmerge.org\0"\r
VALUE "FileDescription", "WinMerge Shell Integration library\0"\r
- VALUE "FileVersion", "1.15.0.3\0"\r
+ VALUE "FileVersion", "1.15.0.4\0"\r
VALUE "InternalName", "ShellExtension\0"\r
- VALUE "LegalCopyright", "Copyright 2003-2010\0"\r
+ VALUE "LegalCopyright", "Copyright 2003-2013\0"\r
VALUE "LegalTrademarks", "\0"\r
VALUE "OLESelfRegister", "\0"\r
VALUE "OriginalFilename", "ShellExtension.DLL\0"\r
VALUE "PrivateBuild", "\0"\r
VALUE "ProductName", "WinMerge Shell Integration library\0"\r
- VALUE "ProductVersion", "1.15.0.3\0"\r
+ VALUE "ProductVersion", "1.15.0.4\0"\r
VALUE "SpecialBuild", "\0"\r
END\r
END\r
//\r
\r
IDB_WINMERGE BITMAP "WinMerge.bmp"\r
+IDB_WINMERGEDIR BITMAP "WinMergeDir.bmp"\r
+IDB_WINMERGEPARENT BITMAP "WinMergeParent.bmp"\r
\r
/////////////////////////////////////////////////////////////////////////////\r
//\r
#ifdef _WIN32\r
LANGUAGE LANG_GREEK, SUBLANG_DEFAULT\r
#pragma code_page(1253)\r
-#include "Languages\\ShellExtensionGreek.rc"\r
+#include "Languages\ShellExtensionGreek.rc"\r
#endif //_WIN32\r
#endif\r
\r
#ifdef _WIN32\r
LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT\r
#pragma code_page(1251)\r
-#include "Languages\\ShellExtensionUkrainian.rc"\r
+#include "Languages\ShellExtensionUkrainian.rc"\r
#endif //_WIN32\r
#endif\r
\r
</CustomBuildStep>\r
<CustomBuildStep Include="ShellExtensionU.def" />\r
<None Include="WinMerge.bmp" />\r
+ <None Include="WinMergeDir.bmp" />\r
+ <None Include="WinMergeParent.bmp" />\r
<None Include="WinMergeShell.rgs" />\r
</ItemGroup>\r
<ItemGroup>\r
<None Include="WinMergeShell.rgs">\r
<Filter>Resource Files</Filter>\r
</None>\r
+ <None Include="WinMergeDir.bmp">\r
+ <Filter>Resource Files</Filter>\r
+ </None>\r
+ <None Include="WinMergeParent.bmp">\r
+ <Filter>Resource Files</Filter>\r
+ </None>\r
</ItemGroup>\r
<ItemGroup>\r
<Midl Include="ShellExtension.idl">\r
// compress or stretch icon bitmap according to menu item height
m_MergeBmp = (HBITMAP)LoadImage(_Module.GetModuleInstance(), MAKEINTRESOURCE(IDB_WINMERGE), IMAGE_BITMAP,
GetSystemMetrics(SM_CXMENUCHECK), GetSystemMetrics(SM_CYMENUCHECK), LR_DEFAULTCOLOR);
+ m_MergeDirBmp = (HBITMAP)LoadImage(_Module.GetModuleInstance(), MAKEINTRESOURCE(IDB_WINMERGEDIR), IMAGE_BITMAP,
+ GetSystemMetrics(SM_CXMENUCHECK), GetSystemMetrics(SM_CYMENUCHECK), LR_DEFAULTCOLOR);
+ m_MergeParentBmp = (HBITMAP)LoadImage(_Module.GetModuleInstance(), MAKEINTRESOURCE(IDB_WINMERGEPARENT), IMAGE_BITMAP,
+ GetSystemMetrics(SM_CXMENUCHECK), GetSystemMetrics(SM_CYMENUCHECK), LR_DEFAULTCOLOR);
}
/// Default destructor, unloads bitmap
CWinMergeShell::~CWinMergeShell()
{
+ DeleteObject(m_MergeParentBmp);
+ DeleteObject(m_MergeDirBmp);
DeleteObject(m_MergeBmp);
}
{
USES_WINMERGELOCALE;
HRESULT hr = E_INVALIDARG;
+
+ m_bParentFolder = false;
// Files/folders selected normally from the explorer
if (pDataObj)
GlobalUnlock(stg.hGlobal);
ReleaseStgMedium(&stg);
}
-
- // No item selected - selection is the folder background
- if (pidlFolder)
+ else if (pidlFolder)
{
+ // No item selected - selection is the folder background
TCHAR szPath[MAX_PATH] = {0};
if (SHGetPathFromIDList(pidlFolder, szPath))
{
m_strPaths[0] = szPath;
m_nSelectedItems = 1;
+ m_bParentFolder = true;
hr = S_OK;
}
else
+ {
hr = E_INVALIDARG;
+ }
}
return hr;
}
InsertMenu(hmenu, uMenuIndex, MF_BYPOSITION, uidFirstCmd, strMenu.c_str());
// Add bitmap
- if (m_MergeBmp != NULL)
- SetMenuItemBitmaps(hmenu, uMenuIndex, MF_BYPOSITION, m_MergeBmp, NULL);
+ HBITMAP hBitmap = m_bParentFolder ? m_MergeParentBmp : (PathIsDirectory(m_strPaths[0].c_str()) ? m_MergeDirBmp : m_MergeBmp);
+ if (hBitmap != NULL)
+ SetMenuItemBitmaps(hmenu, uMenuIndex, MF_BYPOSITION, hBitmap, NULL);
// Show menu item as grayed if more than two items selected
if (m_nSelectedItems > MaxFileCount)
}
// Add bitmap
- if (m_MergeBmp != NULL)
+ HBITMAP hBitmap = m_bParentFolder ? m_MergeParentBmp : (PathIsDirectory(m_strPaths[0].c_str()) ? m_MergeDirBmp : m_MergeBmp);
+ if (hBitmap != NULL)
{
if (nItemsAdded == 2)
- SetMenuItemBitmaps(hmenu, uMenuIndex - 1, MF_BYPOSITION, m_MergeBmp, NULL);
- SetMenuItemBitmaps(hmenu, uMenuIndex, MF_BYPOSITION, m_MergeBmp, NULL);
+ SetMenuItemBitmaps(hmenu, uMenuIndex - 1, MF_BYPOSITION, hBitmap, NULL);
+ SetMenuItemBitmaps(hmenu, uMenuIndex, MF_BYPOSITION, hBitmap, NULL);
}
// Show menu item as grayed if more than two items selected
protected:
String m_strPaths[3]; /**< Paths for selected items */
String m_strPreviousPath; /**< Previously selected path */
- HBITMAP m_MergeBmp; /**< Icon */
+ HBITMAP m_MergeBmp, m_MergeDirBmp, m_MergeParentBmp; /**< Icon */
UINT m_nSelectedItems; /**< Amount of selected items */
DWORD m_dwContextMenuEnabled; /**< Is context menu enabled and in which mode? */
DWORD m_dwMenuState; /**< Shown menuitems */
+ bool m_bParentFolder;
BOOL GetWinMergeDir(String &strDir);
BOOL CheckExecutable(String path);