Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

fogcreek shellext: pass window handle to ShellExecute

Changeset b24bad149059

Parent a3f4dec502da

by David Golub

Changes to 6 files · Browse files at b24bad149059 Showing diff from parent a3f4dec502da Diff from another changeset...

 
44
45
46
47
 
48
49
50
51
52
53
 
54
55
56
57
 
58
59
60
 
71
72
73
74
 
75
76
77
 
44
45
46
 
47
48
49
50
51
52
 
53
54
55
56
 
57
58
59
60
 
71
72
73
 
74
75
76
77
@@ -44,17 +44,17 @@
  return true;  }   -void KilnOpenRepo(const CString& strPath) +void KilnOpenRepo(HWND hWnd, const CString& strPath)  {   CString strKilnUrl;   if (KilnGetUrl(strPath, &strKilnUrl))   {   // Open the repository in the default web browser - ::ShellExecute(NULL, NULL, strKilnUrl, NULL, NULL, SW_SHOW); + ::ShellExecute(hWnd, NULL, strKilnUrl, NULL, NULL, SW_SHOW);   }  }   -void KilnOpenFiles(const CString& strPath, const CAtlArray<CString>& arrFiles) +void KilnOpenFiles(HWND hWnd, const CString& strPath, const CAtlArray<CString>& arrFiles)  {   CString strKilnUrl;   if (KilnGetUrl(strPath, &strKilnUrl)) @@ -71,7 +71,7 @@
  {   CString strRelPath;   GetRelPath(strHgRoot, arrFiles[i], strRelPath); - ::ShellExecute(NULL, NULL, strKilnUrl + strRelPath, NULL, NULL, SW_SHOW); + ::ShellExecute(hWnd, NULL, strKilnUrl + strRelPath, NULL, NULL, SW_SHOW);   }   }  }
 
16
17
18
19
20
 
 
 
 
16
17
18
 
 
19
20
21
@@ -16,5 +16,6 @@
 #pragma once    bool KilnGetUrl(const CString& strPath, CString* pstrKilnUrl = NULL); -void KilnOpenRepo(const CString& strPath); -void KilnOpenFiles(const CString& strPath, const CAtlArray<CString>& arrFiles); +void KilnOpenRepo(HWND hWnd, const CString& strPath); +void KilnOpenFiles(HWND hWnd, const CString& strPath, + const CAtlArray<CString>& arrFiles);
 
630
631
632
633
 
634
635
636
 
821
822
823
824
 
825
826
827
 
873
874
875
876
 
877
878
879
880
881
 
882
883
884
 
630
631
632
 
633
634
635
636
 
821
822
823
 
824
825
826
827
 
873
874
875
 
876
877
878
879
880
 
881
882
883
884
@@ -630,7 +630,7 @@
  const CMenuIdCmdMap::CPair* p = m_mapMenuId.Lookup(idCmd);   if (p != NULL)   { - RunDialog(p->m_value.strName); + RunDialog(lpcmi->hwnd, p->m_value.strName);   hr = S_OK;   }   else @@ -821,7 +821,7 @@
 }     -void CTortoiseHgCmenuBase::RunDialog(const CString& strCmd) +void CTortoiseHgCmenuBase::RunDialog(HWND hWnd, const CString& strCmd)  {   CString strDir = GetTHgProgRoot();   if (strDir.IsEmpty()) @@ -873,12 +873,12 @@
  }   else if (strCmd == "kiln")   { - KilnOpenRepo(strCwd); + KilnOpenRepo(hWnd, strCwd);   return;   }   else if (strCmd == "kilnfiles")   { - KilnOpenFiles(strCwd, m_arrFiles); + KilnOpenFiles(hWnd, strCwd, m_arrFiles);   return;   }  
 
38
39
40
41
 
42
43
44
 
38
39
40
 
41
42
43
44
@@ -38,7 +38,7 @@
  CMenuDescriptionMap m_mapMenuDesc;   CMenuIdCmdMap m_mapMenuId;   - virtual void RunDialog(const CString& strCmd); + virtual void RunDialog(HWND hWnd, const CString& strCmd);     void TweakMenuForVista(HMENU hMenu);   void InitMenuMaps(const CMenuDescription *pMenuDescs, int nCount);
 
79
80
81
82
 
83
84
85
86
87
88
 
89
90
91
 
79
80
81
 
82
83
84
85
86
87
 
88
89
90
91
@@ -79,13 +79,13 @@
  return ResultFromShort(idCmd - idCmdFirst);  }   -void CTortoiseHgDropHandler::RunDialog(const CString& strCmd) +void CTortoiseHgDropHandler::RunDialog(HWND hWnd, const CString& strCmd)  {   if (strCmd == "drag_move" || strCmd == "drag_copy") {   // Append the current directory as the dest.   m_arrFiles.Add(m_strFolder);   } - CTortoiseHgCmenuBase::RunDialog(strCmd); + CTortoiseHgCmenuBase::RunDialog(hWnd, strCmd);  }    STDMETHODIMP CTortoiseHgDropHandler::Initialize(LPCITEMIDLIST pIDFolder,
 
22
23
24
25
 
26
27
28
 
22
23
24
 
25
26
27
28
@@ -22,7 +22,7 @@
  public CComCoClass<CTortoiseHgDropHandler, &CLSID_TortoiseHgDropHandler>  {  protected: - virtual void RunDialog(const CString& strCmd); + virtual void RunDialog(HWND hWnd, const CString& strCmd);    public:   CTortoiseHgDropHandler();