1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2008-2011 - TortoiseGit
4 // Copyright (C) 2003-2008 - TortoiseSVN
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include "TortoiseProc.h"
23 #include "SysImageList.h"
24 #include "CrashReport.h"
25 #include "CmdLineParser.h"
28 #include "PathUtils.h"
29 #include "UnicodeUtils.h"
30 #include "MessageBox.h"
31 //#include "libintl.h"
32 #include "DirFileEnum.h"
33 //#include "SoundUtils.h"
35 #include "GitAdminDir.h"
37 //#include "SVNGlobal.h"
38 //#include "svn_types.h"
39 //#include "svn_dso.h"
40 //#include <openssl/ssl.h>
41 //#include <openssl/err.h>
43 #include "Commands\Command.h"
44 #include "CommonResource.h"
45 #include "..\version.h"
46 #include "JumpListHelpers.h"
47 #include "..\Settings\Settings.h"
50 #define STRUCT_IOVEC_DEFINED
57 #pragma comment(linker, "\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
59 #define APPID (_T("TGIT.TGIT.1") _T(TGIT_PLATFORM))
61 BEGIN_MESSAGE_MAP(CTortoiseProcApp
, CWinAppEx
)
62 ON_COMMAND(ID_HELP
, CWinAppEx::OnHelp
)
66 //CString CGit::m_MsysGitPath;
67 //////////////////////////////////////////////////////////////////////////
69 CTortoiseProcApp::CTortoiseProcApp()
74 // const char* const * argv = NULL;
75 // apr_app_initialize(&argc, &argv, NULL);
76 // svn_dso_initialize2();
80 m_bLoadUserToolbars
= FALSE
;
86 CTortoiseProcApp::~CTortoiseProcApp()
88 // global application exit cleanup (after all SSL activity is shutdown)
89 // we have to clean up SSL ourselves, since neon doesn't do that (can't do it)
90 // because those cleanup functions work globally per process.
93 //CRYPTO_cleanup_all_ex_data();
95 // since it is undefined *when* the global object SVNAdminDir is
96 // destroyed, we tell it to destroy the memory pools and terminate apr
97 // *now* instead of later when the object itself is destroyed.
98 g_GitAdminDir
.Close();
100 SYS_IMAGE_LIST().Cleanup();
104 // The one and only CTortoiseProcApp object
105 CTortoiseProcApp theApp
;
108 BOOL
CTortoiseProcApp::CheckMsysGitDir()
110 CGitIndexFileMap map
;
113 //path.SetFromGit(_T("src/gpl.txt"));
114 //map.GetFileStatus(_T("D:\\TortoiseGit"),&path, &status);
115 return g_Git
.CheckMsysGitDir();
117 CCrashReport
crasher("tortoisegit-bug@googlegroups.com", "Crash Report for TortoiseGit " APP_X64_STRING
" : " STRPRODUCTVER
, TRUE
);// crash
119 // CTortoiseProcApp initialization
121 BOOL
CTortoiseProcApp::InitInstance()
123 EnableCrashHandler();
124 InitializeJumpList();
126 CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows
));
127 CMFCButton::EnableWindowsTheming();
129 Gdiplus::GdiplusStartupInput gdiplusStartupInput
;
130 Gdiplus::GdiplusStartup(&m_gdiplusToken
,&gdiplusStartupInput
,NULL
);
132 if(!CheckMsysGitDir())
134 UINT ret
= CMessageBox::Show(NULL
,_T("MSysGit (http://code.google.com/p/msysgit/) not found."),
135 _T("TortoiseGit"), 3, IDI_HAND
, _T("&Set MSysGit path"), _T("&Goto WebSite"), _T("&Abort"));
138 ShellExecute(NULL
, NULL
, _T("http://code.google.com/p/msysgit/"), NULL
, NULL
, SW_SHOW
);
142 // open settings dialog
143 CSettings
dlg(IDS_PROC_SETTINGS_TITLE
);
144 dlg
.SetTreeViewMode(TRUE
, TRUE
, TRUE
);
145 dlg
.SetTreeWidth(220);
153 //set the resource dll for the required language
154 CRegDWORD loc
= CRegDWORD(_T("Software\\TortoiseGit\\LanguageID"), 1033);
157 CStringA langpath
= CStringA(CPathUtils::GetAppParentDirectory());
158 langpath
+= "Languages";
159 // bindtextdomain("subversion", (LPCSTR)langpath);
160 // bind_textdomain_codeset("subversion", "UTF-8");
161 HINSTANCE hInst
= NULL
;
164 langDll
.Format(_T("..\\Languages\\TortoiseProc%d.dll"), langId
);
166 hInst
= LoadLibrary(langDll
);
168 CString sVer
= _T(STRPRODUCTVER
);
169 CString sFileVer
= CPathUtils::GetVersionFromFile(langDll
);
170 if (sFileVer
.Compare(sVer
)!=0)
177 AfxSetResourceHandle(hInst
);
181 DWORD lid
= SUBLANGID(langId
);
185 langId
= MAKELANGID(PRIMARYLANGID(langId
), lid
);
190 } while ((hInst
== NULL
) && (langId
!= 0));
192 _tcscpy_s(buf
, _T("en"));
195 sHelppath
= this->m_pszHelpFilePath
;
196 sHelppath
= sHelppath
.MakeLower();
197 // MFC uses a help file with the same name as the application by default,
198 // which means we have to change that default to our language specific help files
199 sHelppath
.Replace(_T("tortoiseproc.chm"), _T("TortoiseGit_en.chm"));
200 free((void*)m_pszHelpFilePath
);
201 m_pszHelpFilePath
=_tcsdup(sHelppath
);
202 sHelppath
= CPathUtils::GetAppParentDirectory() + _T("Languages\\TortoiseGit_en.chm");
205 CString sLang
= _T("_");
206 if (GetLocaleInfo(MAKELCID(langId
, SORT_DEFAULT
), LOCALE_SISO639LANGNAME
, buf
, _countof(buf
)))
209 sHelppath
.Replace(_T("_en"), sLang
);
210 if (PathFileExists(sHelppath
))
212 free((void*)m_pszHelpFilePath
);
213 m_pszHelpFilePath
=_tcsdup(sHelppath
);
217 sHelppath
.Replace(sLang
, _T("_en"));
218 if (GetLocaleInfo(MAKELCID(langId
, SORT_DEFAULT
), LOCALE_SISO3166CTRYNAME
, buf
, _countof(buf
)))
222 sHelppath
.Replace(_T("_en"), sLang
);
223 if (PathFileExists(sHelppath
))
225 free((void*)m_pszHelpFilePath
);
226 m_pszHelpFilePath
=_tcsdup(sHelppath
);
230 sHelppath
.Replace(sLang
, _T("_en"));
232 DWORD lid
= SUBLANGID(langId
);
236 langId
= MAKELANGID(PRIMARYLANGID(langId
), lid
);
241 setlocale(LC_ALL
, "");
243 // InitCommonControls() is required on Windows XP if an application
244 // manifest specifies use of ComCtl32.dll version 6 or later to enable
245 // visual styles. Otherwise, any window creation will fail.
247 INITCOMMONCONTROLSEX used
= {
248 sizeof(INITCOMMONCONTROLSEX
),
249 ICC_ANIMATE_CLASS
| ICC_BAR_CLASSES
| ICC_COOL_CLASSES
| ICC_DATE_CLASSES
|
250 ICC_HOTKEY_CLASS
| ICC_INTERNET_CLASSES
| ICC_LISTVIEW_CLASSES
|
251 ICC_NATIVEFNTCTL_CLASS
| ICC_PAGESCROLLER_CLASS
| ICC_PROGRESS_CLASS
|
252 ICC_TAB_CLASSES
| ICC_TREEVIEW_CLASSES
| ICC_UPDOWN_CLASS
|
253 ICC_USEREX_CLASSES
| ICC_WIN95_CLASSES
255 InitCommonControlsEx(&used
);
257 AfxEnableControlContainer();
259 CWinAppEx::InitInstance();
260 SetRegistryKey(_T("TortoiseGit"));
262 CCmdLineParser
parser(AfxGetApp()->m_lpCmdLine
);
264 // if HKCU\Software\TortoiseGit\Debug is not 0, show our command line
266 if (CRegDWORD(_T("Software\\TortoiseGit\\Debug"), FALSE
)==TRUE
)
267 AfxMessageBox(AfxGetApp()->m_lpCmdLine
, MB_OK
| MB_ICONINFORMATION
);
269 if ( parser
.HasKey(_T("path")) && parser
.HasKey(_T("pathfile")))
271 CMessageBox::Show(NULL
, IDS_ERR_INVALIDPATH
, IDS_APPNAME
, MB_ICONERROR
);
275 CTGitPath cmdLinePath
;
276 CTGitPathList pathList
;
277 if ( parser
.HasKey(_T("pathfile")) )
280 CString sPathfileArgument
= CPathUtils::GetLongPathname(parser
.GetVal(_T("pathfile")));
282 cmdLinePath
.SetFromUnknown(sPathfileArgument
);
283 if (pathList
.LoadFromFile(cmdLinePath
)==false)
284 return FALSE
; // no path specified!
285 if ( parser
.HasKey(_T("deletepathfile")) )
287 // We can delete the temporary path file, now that we've loaded it
288 ::DeleteFile(cmdLinePath
.GetWinPath());
290 // This was a path to a temporary file - it's got no meaning now, and
291 // anybody who uses it again is in for a problem...
298 CString sPathArgument
= CPathUtils::GetLongPathname(parser
.GetVal(_T("path")));
299 int asterisk
= sPathArgument
.Find('*');
300 cmdLinePath
.SetFromUnknown(asterisk
>= 0 ? sPathArgument
.Left(asterisk
) : sPathArgument
);
301 pathList
.LoadFromAsteriskSeparatedString(sPathArgument
);
304 if (pathList
.GetCount() == 0) {
305 pathList
.AddPath(CTGitPath::CTGitPath(g_Git
.m_CurrentDir
));
309 CString sVal
= parser
.GetVal(_T("hwnd"));
311 hWndExplorer
= (HWND
)_ttoi64(sVal
);
313 while (GetParent(hWndExplorer
)!=NULL
)
314 hWndExplorer
= GetParent(hWndExplorer
);
315 if (!IsWindow(hWndExplorer
))
320 // Subversion sometimes writes temp files to the current directory!
321 // Since TSVN doesn't need a specific CWD anyway, we just set it
322 // to the users temp folder: that way, Subversion is guaranteed to
323 // have write access to the CWD
325 DWORD len
= GetCurrentDirectory(0, NULL
);
328 TCHAR
* originalCurrentDirectory
= new TCHAR
[len
];
329 if (GetCurrentDirectory(len
, originalCurrentDirectory
))
331 //sOrigCWD = originalCurrentDirectory;
332 //sOrigCWD = CPathUtils::GetLongPathname(sOrigCWD);
334 delete [] originalCurrentDirectory
;
336 TCHAR pathbuf
[MAX_PATH
];
337 GetTempPath(MAX_PATH
, pathbuf
);
338 SetCurrentDirectory(pathbuf
);
341 // check for newer versions
342 if (CRegDWORD(_T("Software\\TortoiseGit\\CheckNewer"), TRUE
) != FALSE
)
348 if ((now
!= 0) && (localtime_s(&ptm
, &now
)==0))
351 // we don't calculate the real 'week of the year' here
352 // because just to decide if we should check for an update
353 // that's not needed.
354 week
= ptm
.tm_yday
/ 7;
356 CRegDWORD oldweek
= CRegDWORD(_T("Software\\TortoiseGit\\CheckNewerWeek"), (DWORD
)-1);
357 if (((DWORD
)oldweek
) == -1)
358 oldweek
= week
; // first start of TortoiseProc, no update check needed
361 if ((DWORD
)week
!= oldweek
)
365 TCHAR com
[MAX_PATH
+100];
366 GetModuleFileName(NULL
, com
, MAX_PATH
);
367 _tcscat_s(com
, MAX_PATH
+100, _T(" /command:updatecheck"));
369 CAppUtils::LaunchApplication(com
, 0, false);
375 if (parser
.HasVal(_T("configdir")))
377 // the user can override the location of the Subversion config directory here
378 CString sConfigDir
= parser
.GetVal(_T("configdir"));
379 // g_GitGlobal.SetConfigDir(sConfigDir);
381 // to avoid that SASL will look for and load its plugin dlls all around the
382 // system, we set the path here.
383 // Note that SASL doesn't have to be initialized yet for this to work
384 // sasl_set_path(SASL_PATH_TYPE_PLUGIN, (LPSTR)(LPCSTR)CUnicodeUtils::GetUTF8(CPathUtils::GetAppDirectory().TrimRight('\\')));
386 HANDLE TSVNMutex
= ::CreateMutex(NULL
, FALSE
, _T("TortoiseGitProc.exe"));
387 if(!g_Git
.SetCurrentDir(cmdLinePath
.GetWinPathString()))
390 for(i
=0;i
<pathList
.GetCount();i
++)
391 if(g_Git
.SetCurrentDir(pathList
[i
].GetWinPath()))
395 if(!g_Git
.m_CurrentDir
.IsEmpty())
396 SetCurrentDirectory(g_Git
.m_CurrentDir
);
402 // requires CWD to be set
403 CGit::m_LogEncode
= CAppUtils::GetLogOutputEncode();
412 UINT choice
= CMessageBox::Show(hWndExplorer
, err
, _T("TortoiseGit Error"), 1, IDI_ERROR
, _T("&Edit .git/config"), _T("Edit &global .gitconfig"), _T("&Abort"));
415 // open the config file with alternative editor
416 CString path
= g_Git
.m_CurrentDir
;
417 path
+= _T("\\.git\\config");
418 CAppUtils::LaunchAlternativeEditor(path
);
420 else if (choice
== 2)
422 // open the global config file with alternative editor
423 char charBuf
[MAX_PATH
];
425 strcpy_s(charBuf
, MAX_PATH
, get_windows_home_directory());
426 _tcscpy_s(buf
, MAX_PATH
, CA2CT(charBuf
));
427 _tcscat_s(buf
, MAX_PATH
, _T("\\.gitconfig"));
428 CAppUtils::LaunchAlternativeEditor(buf
);
434 // execute the requested command
435 CommandServer server
;
436 Command
* cmd
= server
.GetCommand(parser
.GetVal(_T("command")));
439 cmd
->SetExplorerHwnd(hWndExplorer
);
441 cmd
->SetParser(parser
);
442 cmd
->SetPaths(pathList
, cmdLinePath
);
444 retSuccess
= cmd
->Execute();
449 ::CloseHandle(TSVNMutex
);
451 // Look for temporary files left around by TortoiseSVN and
452 // remove them. But only delete 'old' files because some
453 // apps might still be needing the recent ones.
455 DWORD len
= ::GetTempPath(0, NULL
);
456 TCHAR
* path
= new TCHAR
[len
+ 100];
457 len
= ::GetTempPath (len
+100, path
);
460 CSimpleFileFind finder
= CSimpleFileFind(path
, _T("*svn*.*"));
462 ::GetSystemTimeAsFileTime(&systime_
);
463 __int64 systime
= (((_int64
)systime_
.dwHighDateTime
)<<32) | ((__int64
)systime_
.dwLowDateTime
);
464 while (finder
.FindNextFileNoDirectories())
466 CString filepath
= finder
.GetFilePath();
467 HANDLE hFile
= ::CreateFile(filepath
, GENERIC_READ
, FILE_SHARE_READ
, NULL
, OPEN_EXISTING
, NULL
, NULL
);
468 if (hFile
!= INVALID_HANDLE_VALUE
)
470 FILETIME createtime_
;
471 if (::GetFileTime(hFile
, &createtime_
, NULL
, NULL
))
473 ::CloseHandle(hFile
);
474 __int64 createtime
= (((_int64
)createtime_
.dwHighDateTime
)<<32) | ((__int64
)createtime_
.dwLowDateTime
);
475 if ((createtime
+ 864000000000) < systime
) //only delete files older than a day
477 ::SetFileAttributes(filepath
, FILE_ATTRIBUTE_NORMAL
);
478 ::DeleteFile(filepath
);
482 ::CloseHandle(hFile
);
489 // Since the dialog has been closed, return FALSE so that we exit the
490 // application, rather than start the application's message pump.
494 void CTortoiseProcApp::CheckUpgrade()
496 CRegString regVersion
= CRegString(_T("Software\\TortoiseGit\\CurrentVersion"));
497 CString sVersion
= regVersion
;
498 if (sVersion
.Compare(_T(STRPRODUCTVER
))==0)
500 // we're starting the first time with a new version!
503 int pos
= sVersion
.Find(',');
506 lVersion
= (_ttol(sVersion
.Left(pos
))<<24);
507 lVersion
|= (_ttol(sVersion
.Mid(pos
+1))<<16);
508 pos
= sVersion
.Find(',', pos
+1);
509 lVersion
|= (_ttol(sVersion
.Mid(pos
+1))<<8);
512 CRegDWORD regval
= CRegDWORD(_T("Software\\TortoiseGit\\DontConvertBase"), 999);
513 if ((DWORD
)regval
!= 999)
515 // there's a leftover registry setting we have to convert and then delete it
516 CRegDWORD newregval
= CRegDWORD(_T("Software\\TortoiseGit\\ConvertBase"));
518 regval
.removeValue();
521 if (lVersion
<= 0x01010300)
523 CSoundUtils::RegisterTSVNSounds();
524 // remove all saved dialog positions
525 CRegString(_T("Software\\TortoiseGit\\TortoiseProc\\ResizableState\\")).removeKey();
526 CRegDWORD(_T("Software\\TortoiseGit\\RecursiveOverlay")).removeValue();
527 // remove the external cache key
528 CRegDWORD(_T("Software\\TortoiseGit\\ExternalCache")).removeValue();
531 if (lVersion
<= 0x01020200)
533 // upgrade to > 1.2.3 means the doc diff scripts changed from vbs to js
534 // so remove the diff/merge scripts if they're the defaults
535 CRegString diffreg
= CRegString(_T("Software\\TortoiseGit\\DiffTools\\.doc"));
536 CString sDiff
= diffreg
;
537 CString sCL
= _T("wscript.exe \"") + CPathUtils::GetAppParentDirectory()+_T("Diff-Scripts\\diff-doc.vbs\"");
538 if (sDiff
.Left(sCL
.GetLength()).CompareNoCase(sCL
)==0)
540 CRegString mergereg
= CRegString(_T("Software\\TortoiseGit\\MergeTools\\.doc"));
542 sCL
= _T("wscript.exe \"") + CPathUtils::GetAppParentDirectory()+_T("Diff-Scripts\\merge-doc.vbs\"");
543 if (sDiff
.Left(sCL
.GetLength()).CompareNoCase(sCL
)==0)
546 if (lVersion
<= 0x01040000)
548 CRegStdDWORD(_T("Software\\TortoiseGit\\OwnerdrawnMenus")).removeValue();
551 // set the custom diff scripts for every user
552 CString scriptsdir
= CPathUtils::GetAppParentDirectory();
553 scriptsdir
+= _T("Diff-Scripts");
554 CSimpleFileFind
files(scriptsdir
);
555 while (files
.FindNextFileNoDirectories())
557 CString file
= files
.GetFilePath();
558 CString filename
= files
.GetFileName();
559 CString ext
= file
.Mid(file
.ReverseFind('-')+1);
560 ext
= _T(".")+ext
.Left(ext
.ReverseFind('.'));
562 if (file
.Right(3).CompareNoCase(_T("vbs"))==0)
564 kind
= _T(" //E:vbscript");
566 if (file
.Right(2).CompareNoCase(_T("js"))==0)
568 kind
= _T(" //E:javascript");
571 if (filename
.Left(5).CompareNoCase(_T("diff-"))==0)
573 CRegString diffreg
= CRegString(_T("Software\\TortoiseGit\\DiffTools\\")+ext
);
574 CString diffregstring
= diffreg
;
575 if ((diffregstring
.IsEmpty()) || (diffregstring
.Find(filename
)>=0))
576 diffreg
= _T("wscript.exe \"") + file
+ _T("\" %base %mine") + kind
;
578 if (filename
.Left(6).CompareNoCase(_T("merge-"))==0)
580 CRegString diffreg
= CRegString(_T("Software\\TortoiseGit\\MergeTools\\")+ext
);
581 CString diffregstring
= diffreg
;
582 if ((diffregstring
.IsEmpty()) || (diffregstring
.Find(filename
)>=0))
583 diffreg
= _T("wscript.exe \"") + file
+ _T("\" %merged %theirs %mine %base") + kind
;
587 // Initialize "Software\\TortoiseGit\\DiffProps" once with the same value as "Software\\TortoiseGit\\Diff"
588 CRegString regDiffPropsPath
= CRegString(_T("Software\\TortoiseGit\\DiffProps"),_T("non-existant"));
589 CString strDiffPropsPath
= regDiffPropsPath
;
590 if ( strDiffPropsPath
==_T("non-existant") )
592 CString strDiffPath
= CRegString(_T("Software\\TortoiseGit\\Diff"));
593 regDiffPropsPath
= strDiffPath
;
596 // set the current version so we don't come here again until the next update!
597 regVersion
= _T(STRPRODUCTVER
);
600 void CTortoiseProcApp::EnableCrashHandler()
602 // the crash handler is enabled by default, but we disable it
603 // after 3 months after a release
605 #define YEAR ((((__DATE__ [7] - '0') * 10 + (__DATE__ [8] - '0')) * 10 \
606 + (__DATE__ [9] - '0')) * 10 + (__DATE__ [10] - '0'))
608 #define MONTH (__DATE__ [2] == 'n' ? (__DATE__ [1] == 'a' ? 1 : 6) \
609 : __DATE__ [2] == 'b' ? 2 \
610 : __DATE__ [2] == 'r' ? (__DATE__ [0] == 'M' ? 3 : 4) \
611 : __DATE__ [2] == 'y' ? 5 \
612 : __DATE__ [2] == 'l' ? 7 \
613 : __DATE__ [2] == 'g' ? 8 \
614 : __DATE__ [2] == 'p' ? 9 \
615 : __DATE__ [2] == 't' ? 10 \
616 : __DATE__ [2] == 'v' ? 11 : 12)
618 #define DAY ((__DATE__ [4] == ' ' ? 0 : __DATE__ [4] - '0') * 10 \
619 + (__DATE__ [5] - '0'))
621 #define DATE_AS_INT (((YEAR - 2000) * 12 + MONTH) * 31 + DAY)
623 CTime
compiletime(YEAR
, MONTH
, DAY
, 0, 0, 0);
624 CTime now
= CTime::GetCurrentTime();
626 CTimeSpan timediff
= now
-compiletime
;
627 if (timediff
.GetDays() > 3*31)
629 // crasher.Enable(FALSE);
633 void CTortoiseProcApp::InitializeJumpList()
635 // for Win7 : use a custom jump list
638 DeleteJumpList(APPID
);
639 DoInitializeJumpList();
643 void CTortoiseProcApp::DoInitializeJumpList()
645 ATL::CComPtr
<ICustomDestinationList
> pcdl
;
646 HRESULT hr
= pcdl
.CoCreateInstance(CLSID_DestinationList
, NULL
, CLSCTX_INPROC_SERVER
);
650 hr
= pcdl
->SetAppID(APPID
);
655 ATL::CComPtr
<IObjectArray
> poaRemoved
;
656 hr
= pcdl
->BeginList(&uMaxSlots
, IID_PPV_ARGS(&poaRemoved
));
660 ATL::CComPtr
<IObjectCollection
> poc
;
661 hr
= poc
.CoCreateInstance(CLSID_EnumerableObjectCollection
, NULL
, CLSCTX_INPROC_SERVER
);
665 CString sTemp
= CString(MAKEINTRESOURCE(IDS_MENUSETTINGS
));
668 ATL::CComPtr
<IShellLink
> psl
;
669 hr
= CreateShellLink(_T("/command:settings"), (LPCTSTR
)sTemp
, 20, &psl
);
673 sTemp
= CString(MAKEINTRESOURCE(IDS_MENUHELP
));
675 psl
.Release(); // Need to release the object before calling operator&()
676 hr
= CreateShellLink(_T("/command:help"), (LPCTSTR
)sTemp
, 19, &psl
);
681 ATL::CComPtr
<IObjectArray
> poa
;
682 hr
= poc
.QueryInterface(&poa
);
684 pcdl
->AppendCategory((LPCTSTR
)CString(MAKEINTRESOURCE(IDS_PROC_TASKS
)), poa
);
689 int CTortoiseProcApp::ExitInstance()
691 Gdiplus::GdiplusShutdown(m_gdiplusToken
);
693 CWinAppEx::ExitInstance();