OSDN Git Service

Enable GDI+
authorFrank Li <lznuaa@gmail.com>
Sat, 16 May 2009 04:52:53 +0000 (12:52 +0800)
committerFrank Li <lznuaa@gmail.com>
Sat, 16 May 2009 04:52:53 +0000 (12:52 +0800)
src/TortoiseProc/TortoiseProc.cpp
src/TortoiseProc/TortoiseProc.h
src/TortoiseProc/stdafx.h

index d19c3d6..9069748 100644 (file)
@@ -128,7 +128,9 @@ BOOL CTortoiseProcApp::InitInstance()
        CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));\r
        CMFCButton::EnableWindowsTheming();\r
 \r
-       \r
+       Gdiplus::GdiplusStartupInput gdiplusStartupInput;\r
+       Gdiplus::GdiplusStartup(&m_gdiplusToken,&gdiplusStartupInput,NULL);\r
+\r
        if(!CheckMsysGitDir())\r
        {\r
                if(CMessageBox::Show(NULL,_T("MSysGit(http://code.google.com/p/msysgit) have not installed Correctly\n\\r
@@ -616,6 +618,8 @@ void CTortoiseProcApp::EnableCrashHandler()
 \r
 int CTortoiseProcApp::ExitInstance()\r
 {\r
+       Gdiplus::GdiplusShutdown(m_gdiplusToken);\r
+\r
        CWinAppEx::ExitInstance();\r
        if (retSuccess)\r
                return 0;\r
index d61b770..f6c2b7c 100644 (file)
@@ -60,6 +60,7 @@ public:
        void CheckUpgrade();\r
        void EnableCrashHandler();\r
 \r
+       ULONG_PTR m_gdiplusToken;\r
 // Implementation\r
 \r
 private:\r
index b4d57a2..0e86d2d 100644 (file)
@@ -46,6 +46,7 @@
 #include <afxcontrolbars.h>     // MFC support for ribbons and control bars\r
 \r
 #include <atlbase.h>\r
+#include <gdiplus.h>\r
 \r
 #ifndef LVS_EX_DOUBLEBUFFER\r
 #define LVS_EX_DOUBLEBUFFER     0x00010000\r