|
|
@@ -6,7 +6,8 @@
|
|
|
|
|
|
#include "CAppEnv.h"
|
|
|
|
|
|
-
|
|
|
+//用于从zip读取资源
|
|
|
+LPBYTE g_lpResourceZIPBuffer = NULL;
|
|
|
|
|
|
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
|
|
_In_opt_ HINSTANCE hPrevInstance,
|
|
|
@@ -25,10 +26,42 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
|
|
|
|
|
//开始展示窗口
|
|
|
CPaintManagerUI::SetInstance(hInstance);
|
|
|
+
|
|
|
#ifdef NDEBUG
|
|
|
- CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("skin"));
|
|
|
- CPaintManagerUI::SetResourceZip(_T("skin.zpz"));
|
|
|
+ //CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("skin"));
|
|
|
+ //CPaintManagerUI::SetResourceZip(_T("skin.zpz"));
|
|
|
+
|
|
|
+ //从资源中加载zip
|
|
|
+ HRSRC hResource = ::FindResource(CPaintManagerUI::GetResourceDll(), MAKEINTRESOURCE(IDR_ZIPRES1), _T("ZIPRES"));
|
|
|
+ if (hResource == NULL)
|
|
|
+ {
|
|
|
+ return 0L;
|
|
|
+ }
|
|
|
+
|
|
|
+ DWORD dwSize = 0;
|
|
|
+ HGLOBAL hGlobal = ::LoadResource(CPaintManagerUI::GetResourceDll(), hResource);
|
|
|
+ if (hGlobal == NULL)
|
|
|
+ {
|
|
|
+ ::FreeResource(hResource);
|
|
|
+ return 0L;
|
|
|
+ }
|
|
|
+
|
|
|
+ dwSize = ::SizeofResource(CPaintManagerUI::GetResourceDll(), hResource);
|
|
|
+ if (dwSize == 0)
|
|
|
+ {
|
|
|
+ return 0L;
|
|
|
+ }
|
|
|
+
|
|
|
+ g_lpResourceZIPBuffer = new BYTE[dwSize];
|
|
|
+ if (g_lpResourceZIPBuffer != NULL)
|
|
|
+ {
|
|
|
+ ::CopyMemory(g_lpResourceZIPBuffer, (LPBYTE)::LockResource(hGlobal), dwSize);
|
|
|
+ }
|
|
|
+ ::FreeResource(hResource);
|
|
|
+
|
|
|
+ CPaintManagerUI::SetResourceZip(g_lpResourceZIPBuffer, dwSize);
|
|
|
#else
|
|
|
+ //debug模式下
|
|
|
CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("skin"));
|
|
|
#endif
|
|
|
|
|
|
@@ -53,9 +86,10 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
|
|
|
|
|
CPaintManagerUI::MessageLoop();
|
|
|
|
|
|
- app.Stop();
|
|
|
-
|
|
|
::CoUninitialize();
|
|
|
|
|
|
+ //销毁一些环境
|
|
|
+ app.Stop();
|
|
|
+
|
|
|
return 0;
|
|
|
}
|