Changeset 2464ea0f16e1…
Parent 4037f1bffabc…
by
Changes to 2 files · Browse files at 2464ea0f16e1 Showing diff from parent 4037f1bffabc Diff from another changeset...
|
|
@@ -135,15 +135,15 @@ void GetCMenuTranslation(const CString& strLang, LPCTSTR lpszName,
CStringW& strMenuText, CStringW& strHelpText)
{
- CStringW subkey = L"Software\\TortoiseHg\\CMenu\\";
- subkey += strLang;
- subkey += L"\\";
- subkey += lpszName;
+ CStringW strSubKey = L"Software\\TortoiseHg\\CMenu\\";
+ strSubKey += strLang;
+ strSubKey += L"\\";
+ strSubKey += lpszName;
- ATLTRACE(L"GetCMenuTranslation: '%s'\n", (LPCWSTR)subkey);
+ ATLTRACE(L"GetCMenuTranslation: '%s'\n", (LPCWSTR)strSubKey);
HKEY hkey = 0;
- LONG rv = RegOpenKeyExW(HKEY_CURRENT_USER, subkey, 0, KEY_READ, &hkey);
+ LONG rv = RegOpenKeyExW(HKEY_CURRENT_USER, strSubKey, 0, KEY_READ, &hkey);
if (rv == ERROR_SUCCESS && hkey)
{
@@ -152,7 +152,7 @@ }
else
{
- ATLTRACE(L"GetCMenuTranslation: RegOpenKeyExW('%s') failed\n", (LPCWSTR)subkey);
+ ATLTRACE(L"GetCMenuTranslation: RegOpenKeyExW('%s') failed\n", (LPCWSTR)strSubKey);
}
if (hkey)
@@ -163,26 +163,26 @@{
if (m_mapMenuDesc.IsEmpty())
{
- CString lang;
- GetRegistryConfig("CMenuLang", lang);
+ CString strLang;
+ GetRegistryConfig("CMenuLang", strLang);
for (int i = 0; i < nCount; i++)
{
CMenuDescription md = pMenuDescs[i];
- if (md.name.IsEmpty())
+ if (md.strName.IsEmpty())
{
ATLTRACE("**** InitMenuMaps: ignoring entry with empty name\n");
break;
}
- ATLTRACE("InitMenuMaps: adding '%s'\n", (LPCTSTR)md.name);
+ ATLTRACE("InitMenuMaps: adding '%s'\n", (LPCTSTR)md.strName);
// Look for translation of menu and help text
- if (!lang.IsEmpty())
- GetCMenuTranslation(lang, md.name, md.menuText, md.helpText);
+ if (!strLang.IsEmpty())
+ GetCMenuTranslation(strLang, md.strName, md.strMenuText, md.strHelpText);
- m_mapMenuDesc[md.name] = md;
+ m_mapMenuDesc[md.strName] = md;
}
}
@@ -196,21 +196,21 @@{
// MFT_STRING is obsolete and should not be used (replaced by MIIM_STRING
// from Win2K onward)
- MENUITEMINFOW mi;
- memset(&mi, 0, sizeof(mi));
- mi.cbSize = sizeof(mi);
- mi.fMask = MIIM_ID | MIIM_STRING;
- mi.dwTypeData = (LPWSTR)(LPCWSTR)strMenuText;
- mi.cch = strMenuText.GetLength();
- mi.wID = idCmd;
+ MENUITEMINFOW mii;
+ memset(&mii, 0, sizeof(MENUITEMINFOW));
+ mii.cbSize = sizeof(MENUITEMINFOW);
+ mii.fMask = MIIM_ID | MIIM_STRING;
+ mii.dwTypeData = (LPWSTR)(LPCWSTR)strMenuText;
+ mii.cch = strMenuText.GetLength();
+ mii.wID = idCmd;
if (CSysInfo::Instance().IsVistaOrLater())
{
HBITMAP hBmp = GetTortoiseIconBitmap(strIconName);
if (hBmp)
{
- mi.fMask |= MIIM_BITMAP;
- mi.hbmpItem = hBmp;
+ mii.fMask |= MIIM_BITMAP;
+ mii.hbmpItem = hBmp;
}
else
{
@@ -222,16 +222,16 @@ HICON h = GetTortoiseIcon(strIconName);
if (h)
{
- mi.fMask |= MIIM_BITMAP | MIIM_DATA;
- mi.dwItemData = (ULONG_PTR) h;
- mi.hbmpItem = HBMMENU_CALLBACK;
+ mii.fMask |= MIIM_BITMAP | MIIM_DATA;
+ mii.dwItemData = (ULONG_PTR) h;
+ mii.hbmpItem = HBMMENU_CALLBACK;
}
else
{
ATLTRACE(" ***** InsertMenuItemWithIcon1: can't find '%s'\n", strIconName);
}
}
- InsertMenuItemW(hMenu, indexMenu, TRUE, &mi);
+ InsertMenuItemW(hMenu, indexMenu, TRUE, &mii);
ATLTRACE(L"InsertMenuItemWithIcon1('%s') finished\n", strMenuText);
}
@@ -243,22 +243,22 @@{
// MFT_STRING is obsolete and should not be used (replaced by MIIM_STRING
// from Win2K onward)
- MENUITEMINFOW mi;
- memset(&mi, 0, sizeof(mi));
- mi.cbSize = sizeof(mi);
- mi.fMask = MIIM_SUBMENU | MIIM_ID | MIIM_STRING;
- mi.dwTypeData = (LPWSTR)(LPCWSTR)strMenuText;
- mi.cch = strMenuText.GetLength();
- mi.wID = idCmd;
- mi.hSubMenu = hSubMenu;
+ MENUITEMINFOW mii;
+ memset(&mii, 0, sizeof(MENUITEMINFOW));
+ mii.cbSize = sizeof(MENUITEMINFOW);
+ mii.fMask = MIIM_SUBMENU | MIIM_ID | MIIM_STRING;
+ mii.dwTypeData = (LPWSTR)(LPCWSTR)strMenuText;
+ mii.cch = strMenuText.GetLength();
+ mii.wID = idCmd;
+ mii.hSubMenu = hSubMenu;
if (CSysInfo::Instance().IsVistaOrLater())
{
HBITMAP hBmp = GetTortoiseIconBitmap(strIconName);
if (hBmp)
{
- mi.fMask |= MIIM_BITMAP;
- mi.hbmpItem = hBmp;
+ mii.fMask |= MIIM_BITMAP;
+ mii.hbmpItem = hBmp;
}
else
{
@@ -267,12 +267,12 @@ }
else
{
- HICON h = GetTortoiseIcon(strIconName);
- if (h)
+ HICON hIcon = GetTortoiseIcon(strIconName);
+ if (hIcon)
{
- mi.fMask |= MIIM_BITMAP | MIIM_DATA;
- mi.dwItemData = (ULONG_PTR) h;
- mi.hbmpItem = HBMMENU_CALLBACK;
+ mii.fMask |= MIIM_BITMAP | MIIM_DATA;
+ mii.dwItemData = (ULONG_PTR)hIcon;
+ mii.hbmpItem = HBMMENU_CALLBACK;
}
else
{
@@ -280,7 +280,7 @@ }
}
- InsertMenuItemW(hMenu, indexMenu, TRUE, &mi);
+ InsertMenuItemW(hMenu, indexMenu, TRUE, &mii);
ATLTRACE(L"InsertMenuItemWithIcon2('%s') finished\n", (LPCWSTR)strMenuText);
}
@@ -300,7 +300,7 @@ const CMenuDescription& md = pPair->m_value;
AddMenuList(idCmd - idCmdFirst, strName);
InsertMenuItemWithIcon1(
- hMenu, indexMenu, idCmd, strPrefix + md.menuText, md.iconName);
+ hMenu, indexMenu, idCmd, strPrefix + md.strMenuText, md.strIconName);
}
@@ -311,23 +311,23 @@{
bHasMenu = false;
- const int count = ::GetMenuItemCount(hMenu);
- if (count == -1)
+ int nCount = ::GetMenuItemCount(hMenu);
+ if (nCount == -1)
{
ATLTRACE("***** HasTortoiseMenu: GetMenuItemCount returned -1\n");
return -1;
}
MENUITEMINFOW mii;
- for (int i = 0; i < count; ++i)
+ for (int i = 0; i < nCount; ++i)
{
memset(&mii, 0, sizeof(MENUITEMINFOW));
mii.cbSize = sizeof(MENUITEMINFOW);
// first GetMenuItemInfoW call: get size of menu item string
mii.fMask = MIIM_STRING;
- BOOL res = ::GetMenuItemInfoW(hMenu, i, true, &mii);
- if (res == 0) {
+ BOOL bRes = ::GetMenuItemInfoW(hMenu, i, true, &mii);
+ if (bRes == 0) {
ATLTRACE("HasTortoiseMenu: first GetMenuItemInfo returned 0\n");
continue;
}
@@ -345,9 +345,9 @@ // second GetMenuItemInfoW call: get string into buffer
mii.dwTypeData = lpszBuf;
++mii.cch; // size of buffer is one more than length of string
- res = ::GetMenuItemInfoW(hMenu, i, true, &mii);
+ bRes = ::GetMenuItemInfoW(hMenu, i, true, &mii);
strMenuItemText.ReleaseBuffer();
- if (res == 0) {
+ if (bRes == 0) {
ATLTRACE("HasTortoiseMenu: second GetMenuItemInfo returned 0\n");
continue;
}
@@ -369,12 +369,13 @@ if (!CSysInfo::Instance().IsVistaOrLater())
return;
- MENUINFO MenuInfo = {};
- MenuInfo.cbSize = sizeof(MenuInfo);
- MenuInfo.fMask = MIM_STYLE | MIM_APPLYTOSUBMENUS;
- MenuInfo.dwStyle = MNS_CHECKORBMP;
+ MENUINFO mi;
+ memset(&mi, 0, sizeof(MENUINFO));
+ mi.cbSize = sizeof(MENUINFO);
+ mi.fMask = MIM_STYLE | MIM_APPLYTOSUBMENUS;
+ mi.dwStyle = MNS_CHECKORBMP;
- SetMenuInfo(hMenu, &MenuInfo);
+ SetMenuInfo(hMenu, &mi);
}
#define ResultFromShort(i) ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i)))
@@ -401,8 +402,8 @@ if (!bAppendItems)
return S_OK;
- bool hasthgmenu = false;
- if (HasTortoiseMenu(hMenu, hasthgmenu) == 0 && hasthgmenu)
+ bool bHasTHgMenu = false;
+ if (HasTortoiseMenu(hMenu, bHasTHgMenu) == 0 && bHasTHgMenu)
{
ATLTRACE("CTortoiseHgCmenuBase::QueryContextMenu: "
"TortoiseHg menu entry already in menu -> skipping");
@@ -414,31 +415,31 @@ CString promoted_string = "commit,workbench"; // default value if key not found
GetRegistryConfig("PromotedItems", promoted_string);
- CAtlList<CString> promoted;
- Tokenize(promoted_string, promoted, ",");
+ CAtlList<CString> listPromoted;
+ Tokenize(promoted_string, listPromoted, ",");
// Select menu to show
- bool fileMenu = !m_arrFiles.IsEmpty();
- bool isHgrepo = false;
- CString cwd;
+ bool bFileMenu = !m_arrFiles.IsEmpty();
+ bool bIsHgRepo = false;
+ CString strCwd;
if (!m_strFolder.IsEmpty())
{
- cwd = m_strFolder;
+ strCwd = m_strFolder;
}
- else if (fileMenu)
+ else if (bFileMenu)
{
- cwd = ::PathIsDirectory(m_arrFiles[0]) ? m_arrFiles[0] : DirName(m_arrFiles[0]);
+ strCwd = ::PathIsDirectory(m_arrFiles[0]) ? m_arrFiles[0] : DirName(m_arrFiles[0]);
}
- if (!cwd.IsEmpty())
+ if (!strCwd.IsEmpty())
{
// check if target directory is a Mercurial repository
- CString root = GetHgRepoRoot(cwd);
- isHgrepo = !root.IsEmpty();
- if (m_arrFiles.GetCount() == 1 && root == m_arrFiles[0])
+ CString strRoot = GetHgRepoRoot(strCwd);
+ bIsHgRepo = !strRoot.IsEmpty();
+ if (m_arrFiles.GetCount() == 1 && strRoot == m_arrFiles[0])
{
- fileMenu = false;
- m_strFolder = cwd;
+ bFileMenu = false;
+ m_strFolder = strCwd;
m_arrFiles.RemoveAll();
}
}
@@ -446,41 +447,41 @@ if ((uFlags & CMF_EXTENDEDVERBS) == 0)
{
// shift key is not down
- if (!isHgrepo)
+ if (!bIsHgRepo)
{
// we are not inside a repo
- CString cval;
- if (GetRegistryConfig("HideMenuOutsideRepo", cval) != 0 && cval == "1")
+ CString strCval;
+ if (GetRegistryConfig("HideMenuOutsideRepo", strCval) != 0 && strCval == "1")
{
return S_OK; // don't show thg cmenu entries
}
}
}
- ATLTRACE("CTortoiseHgCmenuBase::QueryContextMenu: isHgrepo = %d, fileMenu = %d\n",
- isHgrepo, fileMenu);
+ ATLTRACE("CTortoiseHgCmenuBase::QueryContextMenu: bIsHgRepo = %d, bFileMenu = %d\n",
+ bIsHgRepo, bFileMenu);
/* We have three menu types: files-selected, no-files-selected, no-repo */
- const char* entries_string = 0;
- if (isHgrepo)
- if (fileMenu)
- entries_string = RepoFilesMenu;
+ LPCTSTR lpszEntries = 0;
+ if (bIsHgRepo)
+ if (bFileMenu)
+ lpszEntries = RepoFilesMenu;
else
- entries_string = RepoNoFilesMenu;
+ lpszEntries = RepoNoFilesMenu;
else
- entries_string = NoRepoMenu;
+ lpszEntries = NoRepoMenu;
// start building TortoiseHg menus and submenus
InsertMenu(hMenu, indexMenu++, MF_SEPARATOR | MF_BYPOSITION, 0, NULL);
- CAtlList<CString> entries;
- Tokenize(entries_string, entries, " ");
+ CAtlList<CString> listEntries;
+ Tokenize(lpszEntries, listEntries, " ");
- POSITION position = entries.GetHeadPosition();
+ POSITION position = listEntries.GetHeadPosition();
while (position != NULL)
{
- CString strName = entries.GetNext(position);
- if (promoted.Find(strName) != NULL)
+ CString strName = listEntries.GetNext(position);
+ if (listPromoted.Find(strName) != NULL)
{
InsertMenuItemByName(hMenu, strName, indexMenu++, idCmd++, idCmdFirst, L"Hg ");
}
@@ -490,33 +491,33 @@ if (hSubMenu)
{
UINT indexSubMenu = 0;
- bool isSeparator = true;
- POSITION position = entries.GetHeadPosition();
+ bool bIsSeparator = true;
+ POSITION position = listEntries.GetHeadPosition();
while (position != NULL)
{
- CString strName = entries.GetNext(position);
+ CString strName = listEntries.GetNext(position);
if (strName == "sep")
{
- if (!isSeparator)
+ if (!bIsSeparator)
{
InsertMenu(
hSubMenu, indexSubMenu++,
MF_SEPARATOR | MF_BYPOSITION, 0, NULL
);
- isSeparator = true;
+ bIsSeparator = true;
}
}
else
{
- if (promoted.Find(strName) == NULL)
+ if (listPromoted.Find(strName) == NULL)
{
InsertMenuItemByName(hSubMenu, strName, indexSubMenu++, idCmd++,
idCmdFirst, L"");
- isSeparator = false;
+ bIsSeparator = false;
}
}
}
- if (isSeparator && indexSubMenu > 0)
+ if (bIsSeparator && indexSubMenu > 0)
RemoveMenu(hSubMenu, indexSubMenu - 1, MF_BYPOSITION);
TweakMenuForVista(hSubMenu);
@@ -550,7 +551,7 @@ const CMenuIdCmdMap::CPair* p = m_mapMenuId.Lookup(idCmd);
if (p != NULL)
{
- RunDialog(p->m_value.name);
+ RunDialog(p->m_value.strName);
hr = S_OK;
}
else
@@ -570,30 +571,30 @@{
// see http://msdn.microsoft.com/en-us/library/bb776094%28VS.85%29.aspx
- HRESULT res = S_FALSE;
+ HRESULT hr = S_FALSE;
const char* psz = "";
const wchar_t* pszw = 0;
- CString sflags = "?";
+ CString strFlags = "?";
switch (uFlags)
{
case GCS_HELPTEXTW:
- sflags = "GCS_HELPTEXTW"; break;
+ strFlags = "GCS_HELPTEXTW"; break;
case GCS_HELPTEXTA:
- sflags = "GCS_HELPTEXTA"; break;
+ strFlags = "GCS_HELPTEXTA"; break;
case GCS_VALIDATEW:
- sflags = "GCS_VALIDATEW"; break;
+ strFlags = "GCS_VALIDATEW"; break;
case GCS_VALIDATEA:
- sflags = "GCS_VALIDATEA"; break;
+ strFlags = "GCS_VALIDATEA"; break;
case GCS_VERBW:
- sflags = "GCS_VERBW"; break;
+ strFlags = "GCS_VERBW"; break;
case GCS_VERBA:
- sflags = "GCS_VERBA"; break;
+ strFlags = "GCS_VERBA"; break;
}
ATLTRACE("CTortoiseHgCmenuBase::GetCommandString: idCmd = %d, uFlags = %d (%s), "
- "cchMax = %d\n", idCmd, uFlags, sflags, cchMax);
+ "cchMax = %d\n", idCmd, uFlags, strFlags, cchMax);
const CMenuIdCmdMap::CPair* p = m_mapMenuId.Lookup((UINT)idCmd);
if (p == NULL)
@@ -602,14 +603,14 @@ }
else
{
- ATLTRACE("CTortoiseHgCmenuBase::GetCommandString: name = '%s'\n", p->m_value.name);
+ ATLTRACE("CTortoiseHgCmenuBase::GetCommandString: name = '%s'\n", p->m_value.strName);
if (uFlags == GCS_HELPTEXTW)
{
- pszw = p->m_value.helpText;
- res = S_OK;
+ pszw = p->m_value.strHelpText;
+ hr = S_OK;
- size_t size = p->m_value.helpText.GetLength();
+ size_t size = p->m_value.strHelpText.GetLength();
if (size >= 40)
{
ATLTRACE("***** CTortoiseHgCmenuBase::GetCommandString: warning: "
@@ -621,7 +622,7 @@ {
// we don't provide ansi help texts
psz = "";
- res = S_OK;
+ hr = S_OK;
}
else if (uFlags == GCS_VERBW || uFlags == GCS_VERBA)
{
@@ -631,62 +632,62 @@ // bugfix: don't provide verbs ("rename" conflicted with rename of explorer)
psz = "";
#endif
- res = S_OK;
+ hr = S_OK;
}
else if (uFlags == GCS_VALIDATEW || uFlags == GCS_VALIDATEA)
{
- res = S_OK;
+ hr = S_OK;
}
}
if (cchMax < 1)
{
ATLTRACE("CTortoiseHgCmenuBase::GetCommandString: cchMax = %d (is <1)\n", cchMax);
- return res;
+ return hr;
}
- size_t size = 0;
+ size_t nSize = 0;
if (uFlags & GCS_UNICODE)
{
- wchar_t* const dest = reinterpret_cast<wchar_t*>(pszName);
- CStringW wpsz = psz;
- const wchar_t* const src = pszw ? pszw : wpsz;
+ LPWSTR lpszDest = (LPWSTR)pszName;
+ CStringW strUnicode = psz;
+ LPCWSTR lpszSrc = pszw ? pszw : strUnicode;
- wcsncpy_s(dest, cchMax, src, cchMax-1);
- *(dest + cchMax-1) = 0;
+ wcsncpy_s(lpszDest, cchMax, lpszSrc, cchMax-1);
+ *(lpszDest + cchMax-1) = 0;
- size = wcslen(src);
+ nSize = wcslen(lpszSrc);
ATLTRACE(L"CTortoiseHgCmenuBase::GetCommandString: res = %d, "
- L"pszName (wide) = '%s'\n", (int)res, dest);
+ L"pszName (wide) = '%s'\n", (int)hr, lpszDest);
}
else
{
strncpy_s(pszName, cchMax, psz, cchMax-1);
*(pszName + cchMax-1) = 0;
- size = strlen(psz);
+ nSize = strlen(psz);
ATLTRACE("CShellExtCMenu::GetCommandString: res = %d, pszName = '%s'\n",
- (int)res, psz);
+ (int)hr, psz);
}
- if (size > cchMax-1)
+ if (nSize > cchMax-1)
{
ATLTRACE("***** CShellExtCMenu::GetCommandString: string was truncated: "
- "size = %d, cchMax = %d\n", size, cchMax);
+ "size = %d, cchMax = %d\n", nSize, cchMax);
}
- return res;
+ return hr;
}
STDMETHODIMP
CTortoiseHgCmenuBase::HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- LRESULT res;
- return HandleMenuMsg2(uMsg, wParam, lParam, &res);
+ LRESULT lResult;
+ return HandleMenuMsg2(uMsg, wParam, lParam, &lResult);
}
@@ -697,9 +698,9 @@ // A great tutorial on owner drawn menus in shell extension can be found
// here: http://www.codeproject.com/shell/shellextguide7.asp
- LRESULT res;
+ LRESULT lResult;
if (!pResult)
- pResult = &res;
+ pResult = &lResult;
*pResult = FALSE;
switch (uMsg)
@@ -743,38 +744,38 @@
void CTortoiseHgCmenuBase::RunDialog(const CString& strCmd)
{
- CString dir = GetTHgProgRoot();
- if (dir.IsEmpty())
+ CString strDir = GetTHgProgRoot();
+ if (strDir.IsEmpty())
{
ATLTRACE("RunDialog: THG root is empty\n");
return;
}
- CString hgcmd = dir + "\\thgw.exe";
+ CString strHgCmd = strDir + "\\thgw.exe";
WIN32_FIND_DATAA data;
- HANDLE hfind = FindFirstFileA(hgcmd, &data);
- if (hfind == INVALID_HANDLE_VALUE)
+ HANDLE hFind = FindFirstFileA(strHgCmd, &data);
+ if (hFind == INVALID_HANDLE_VALUE)
{
- hgcmd = dir + "\\hgtk.exe";
- hfind = FindFirstFileA(hgcmd, &data);
- if (hfind == INVALID_HANDLE_VALUE)
- hgcmd = dir + "\\thg.cmd";
+ strHgCmd = strDir + "\\hgtk.exe";
+ hFind = FindFirstFileA(strHgCmd, &data);
+ if (hFind == INVALID_HANDLE_VALUE)
+ strHgCmd = strDir + "\\thg.cmd";
else
- FindClose(hfind);
+ FindClose(hFind);
}
else
- FindClose(hfind);
+ FindClose(hFind);
- hgcmd = Quote(hgcmd) + " --nofork " + strCmd;
+ strHgCmd = Quote(strHgCmd) + " --nofork " + strCmd;
- CString cwd;
+ CString strCwd;
if (!m_strFolder.IsEmpty())
{
- cwd = m_strFolder;
+ strCwd = m_strFolder;
}
else if (!m_arrFiles.IsEmpty())
{
- cwd = ::PathIsDirectory(m_arrFiles[0]) ? m_arrFiles[0] : DirName(m_arrFiles[0]);
+ strCwd = ::PathIsDirectory(m_arrFiles[0]) ? m_arrFiles[0] : DirName(m_arrFiles[0]);
}
else
{
@@ -784,10 +785,10 @@
if (strCmd == "thgstatus")
{
- if (CTHgStatus::Remove(cwd) != 0)
+ if (CTHgStatus::Remove(strCwd) != 0)
{
- CString p = dir + "\\TortoiseHgOverlayServer.exe";
- LaunchCommand(Quote(p), dir);
+ CString strPath = strDir + "\\TortoiseHgOverlayServer.exe";
+ LaunchCommand(Quote(strPath), strDir);
}
CInitStatus::Check();
return;
@@ -795,21 +796,21 @@
if (!m_arrFiles.IsEmpty())
{
- CString tempfile = GetTemporaryFile();
- if (tempfile.IsEmpty())
+ CString strTempFile = GetTemporaryFile();
+ if (strTempFile.IsEmpty())
{
ATLTRACE("***** RunDialog: error: GetTemporaryFile returned empty string\n");
return;
}
- ATLTRACE("RunDialog: temp file = %s\n", (LPCTSTR)tempfile);
- HANDLE tempfileHandle = CreateFileA(tempfile, GENERIC_WRITE, FILE_SHARE_READ, 0,
+ ATLTRACE("RunDialog: temp file = %s\n", (LPCTSTR)strTempFile);
+ HANDLE hTempFile = CreateFileA(strTempFile, GENERIC_WRITE, FILE_SHARE_READ, 0,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
- if (tempfileHandle == INVALID_HANDLE_VALUE)
+ if (hTempFile == INVALID_HANDLE_VALUE)
{
ATLTRACE("***** RunDialog: error: failed to create file '%s'\n",
- (LPCTSTR)tempfile);
+ (LPCTSTR)strTempFile);
return;
}
@@ -817,14 +818,14 @@ {
DWORD dwWritten;
ATLTRACE("RunDialog: temp file adding '%s'\n", (LPCTSTR)m_arrFiles[i]);
- WriteFile(tempfileHandle, (LPCTSTR)m_arrFiles[i], m_arrFiles[i].GetLength(), &dwWritten, 0);
- WriteFile(tempfileHandle, "\n", 1, &dwWritten, 0);
+ WriteFile(hTempFile, (LPCTSTR)m_arrFiles[i], m_arrFiles[i].GetLength(), &dwWritten, 0);
+ WriteFile(hTempFile, "\n", 1, &dwWritten, 0);
}
- CloseHandle(tempfileHandle);
- hgcmd += " --listfile " + Quote(tempfile);
+ CloseHandle(hTempFile);
+ strHgCmd += " --listfile " + Quote(strTempFile);
}
- LaunchCommand(hgcmd, cwd);
+ LaunchCommand(strHgCmd, strCwd);
CInitStatus::Check();
}
@@ -834,13 +835,13 @@
// get installed MSI product id (for debugging purposes for now)
#ifdef _M_X64
- const char* shellexid = "{D5D1E532-CDAD-4FFD-9695-757B8A29B4BA}";
+ LPCTSTR lpszShellExId = "{D5D1E532-CDAD-4FFD-9695-757B8A29B4BA}";
#else
- const char* shellexid = "{728E8840-5878-4EA7-918F-281C2697ABB1}";
+ LPCTSTR lpszShellExId = "{728E8840-5878-4EA7-918F-281C2697ABB1}";
#endif
char szProductId[50];
- UINT msires = ::MsiGetProductCodeA(shellexid, szProductId);
- ATLTRACE("MSI shellexid: %s\n", shellexid);
+ UINT msires = ::MsiGetProductCodeA(lpszShellExId, szProductId);
+ ATLTRACE("MSI shellexid: %s\n", lpszShellExId);
ATLTRACE("MSI msires: %d", msires);
ATLTRACE("MSI installed product id: %s\n", szProductId);
@@ -867,7 +868,7 @@STDMETHODIMP CTortoiseHgCmenuBase::Initialize(
LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObj, HKEY hRegKey)
{
- TCHAR name[MAX_PATH+1];
+ TCHAR szName[MAX_PATH+1];
PrintDebugHeader(pIDFolder, pDataObj);
@@ -887,10 +888,10 @@ UINT uNumFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);
ATLTRACE(" hDrop uNumFiles = %d\n", uNumFiles);
for (UINT i = 0; i < uNumFiles; ++i) {
- if (DragQueryFile(hDrop, i, name, MAX_PATH) > 0)
+ if (DragQueryFile(hDrop, i, szName, MAX_PATH) > 0)
{
- ATLTRACE(" DragQueryFile [%d] = '%s'\n", i, name);
- m_arrFiles.Add(name);
+ ATLTRACE(" DragQueryFile [%d] = '%s'\n", i, szName);
+ m_arrFiles.Add(szName);
}
}
}
@@ -915,9 +916,9 @@ // if a directory background
if (pIDFolder)
{
- SHGetPathFromIDList(pIDFolder, name);
- ATLTRACE(" Folder '%s'\n", name);
- m_strFolder = name;
+ SHGetPathFromIDList(pIDFolder, szName);
+ ATLTRACE(" Folder '%s'\n", szName);
+ m_strFolder = szName;
}
// disable context menu if neither the folder nor the files
|
@@ -3,10 +3,10 @@
struct CMenuDescription
{
- CString name;
- CStringW menuText;
- CStringW helpText;
- CString iconName;
+ CString strName;
+ CStringW strMenuText;
+ CStringW strHelpText;
+ CString strIconName;
UINT idCmd;
};
|
Loading...