Commit b3f92d51 authored by Joachim Eibl's avatar Joachim Eibl

Vista/Win7: Shell context menu now again displays text.

git-svn-id: https://kdiff3.svn.sourceforge.net/svnroot/kdiff3/trunk@170 c8aa9fed-2811-0410-8543-893ada326672
parent 4f8cba93
......@@ -16,6 +16,7 @@ Version 0.9.97 - 2012-07-14
- Added default directory anti patterns ".hg" and ".git" and file anti patterns ".rej" and ".bak" for better mercurial and git integration.
- Command line option --cs doesn't change the config value permanently anymore.
- On KDE: Not creating a KDiff3Part anymore.
- Windows (Vista or Win 7): Shell context menu in directory comparison view now again displays text.
Version 0.9.96 - 2011-09-02
===========================
......
......@@ -61,7 +61,7 @@ tstring SERVER::getRegistryKeyString( const tstring& subKey, const tstring& valu
tstring result;
for(;;)
{
if( RegOpenKeyEx( baseKey, keyName.c_str(), 0, KEY_READ, &key ) == ERROR_SUCCESS )
if( RegOpenKeyEx( baseKey, keyName.c_str(), 0, KEY_READ | KEY_WOW64_64KEY, &key ) == ERROR_SUCCESS )
{
DWORD neededSizeInBytes = 0;
if (RegQueryValueEx(key, value.c_str(), 0, 0, 0, &neededSizeInBytes) == ERROR_SUCCESS)
......@@ -268,7 +268,7 @@ SERVER::save_history() const
{
HKEY key;
if( RegCreateKeyEx(HKEY_CURRENT_USER, (m_registryBaseName + TEXT("\\history")).c_str(), 0, 0,
REG_OPTION_NON_VOLATILE, KEY_WRITE, 0, &key, 0) == ERROR_SUCCESS )
REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_WOW64_64KEY, 0, &key, 0) == ERROR_SUCCESS )
{
LOG();
//DWORD len = MAX_PATH;
......
......@@ -15,6 +15,7 @@
* *
***************************************************************************/
// ShellContextMenu.cpp: Implementierung der Klasse CShellContextMenu.
// http://www.codeproject.com/Articles/4025/Use-Shell-ContextMenu-in-your-applications
//
//////////////////////////////////////////////////////////////////////
#ifdef _WIN32
......@@ -53,6 +54,7 @@ void showShellContextMenu( const QString& itemPath, QPoint pt, QWidget* pParentW
IContextMenu2 * g_IContext2 = NULL;
IContextMenu3 * g_IContext3 = NULL;
static WNDPROC OldWndProc = 0;
CShellContextMenu::CShellContextMenu()
{
......@@ -142,10 +144,9 @@ LRESULT CALLBACK CShellContextMenu::HookWndProc(HWND hWnd, UINT message, WPARAM
}
// call original WndProc of window to prevent undefined bevhaviour of window
return ::CallWindowProc ((WNDPROC) GetProp ( hWnd, TEXT ("OldWndProc")), hWnd, message, wParam, lParam);
return ::CallWindowProc (OldWndProc, hWnd, message, wParam, lParam);
}
UINT CShellContextMenu::ShowContextMenu(QWidget * pParentWidget, QPoint pt, QMenu* pMenu )
{
HWND hWnd = pParentWidget->winId();
......@@ -175,10 +176,10 @@ UINT CShellContextMenu::ShowContextMenu(QWidget * pParentWidget, QPoint pt, QMen
pContextMenu->QueryContextMenu (m_hMenu, GetMenuItemCount (m_hMenu), MIN_ID, MAX_ID, CMF_NORMAL | CMF_EXPLORE);
// subclass window to handle menurelated messages in CShellContextMenu
WNDPROC OldWndProc;
if (iMenuType > 1) // only subclass if its version 2 or 3
{
OldWndProc = (WNDPROC) SetWindowLongPtr (hWnd, GWLP_WNDPROC, (LONG_PTR) HookWndProc);
OldWndProc = (WNDPROC) SetWindowLongPtr (hWnd, GWLP_WNDPROC, (DWORD_PTR) HookWndProc);
if (iMenuType == 2)
g_IContext2 = (LPCONTEXTMENU2) pContextMenu;
else // version 3
......@@ -190,7 +191,7 @@ UINT CShellContextMenu::ShowContextMenu(QWidget * pParentWidget, QPoint pt, QMen
UINT idCommand = TrackPopupMenu (m_hMenu,TPM_RETURNCMD | TPM_LEFTALIGN, pt.x(), pt.y(), 0, pParentWidget->winId(), 0);
if (OldWndProc) // unsubclass
SetWindowLongPtr (hWnd, GWLP_WNDPROC, (LONG_PTR) OldWndProc);
SetWindowLongPtr (hWnd, GWLP_WNDPROC, (DWORD_PTR) OldWndProc);
if (idCommand >= MIN_ID && idCommand <= MAX_ID) // see if returned idCommand belongs to shell menu entries
{
......
......@@ -164,6 +164,8 @@ int main(int argc, char *argv[])
QByteArray appVersion = QByteArray( VERSION );
if ( sizeof(void*)==8 )
appVersion += " (64 bit)";
else if ( sizeof(void*)==4 )
appVersion += " (32 bit)";
const KLocalizedString description = ki18n("Tool for Comparison and Merge of Files and Directories");
const KLocalizedString copyright = ki18n("(c) 2002-2011 Joachim Eibl");
const QByteArray& homePage = "http://kdiff3.sourceforge.net/";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment