Changeset b613087f5bdd…
Parent 1f51c7f62171…
by
Changes to 2 files · Browse files at b613087f5bdd Showing diff from parent 1f51c7f62171 Diff from another changeset...
@@ -18,6 +18,7 @@
#include "TortoiseHgKeyboard.h"
#include "TortoiseUtils.h"
+#include "RunDialog.h"
// Each Windows Explorer window is launched in a separate thread. Therefore, use thread
// local storage so that each thread can have its own hook.
@@ -74,10 +75,15 @@ {
if (KeyShortcutList[i].wKey == wParam && KeyShortcutList[i].wFlags == wFlags)
{
+ // Get the selected files and the current directory.
CAtlList<CString> listFiles;
g_pObject->GetSelectedFiles(listFiles);
CString strFolder;
g_pObject->GetFolder(strFolder);
+
+ // Run the command corresponding to the shortcut.
+ RunDialog(g_pObject->GetExplorerWindow(), KeyShortcutList[i].strName,
+ listFiles, strFolder);
}
}
}
@@ -155,6 +161,15 @@ return true;
}
+HWND CTortoiseHgKeyboard::GetExplorerWindow()
+{
+ CComQIPtr<IWebBrowser2> spWB = m_spUnkSite;
+ if (spWB == NULL) return NULL;
+ SHANDLE_PTR hWnd;
+ if (FAILED(spWB->get_HWND(&hWnd))) return NULL;
+ return (HWND)hWnd;
+}
+
CTortoiseHgKeyboard::CTortoiseHgKeyboard() :
m_hHook(NULL)
{
|
@@ -40,6 +40,7 @@ bool GetActiveShellView(IShellView** ppSV);
bool GetSelectedFiles(CAtlList<CString>& listFiles);
bool GetFolder(CString& strFolder);
+ HWND GetExplorerWindow();
static LRESULT CALLBACK HookProc(int code, WPARAM wParam, LPARAM lParam);
};
|
Loading...