[RAPPS] Screenshot preview and other trivial fixes (#2894)

* add one more layer of window
* using Path* API to operate path
* always use rappmgr.cab as file name when downloading db. ignore the URL
* add snapshot preview window
* show a broken-image icon when failed to load image
* add a padding between image and content, and make sure always some space is reserved for richedit
* hide the padding if snapshot window does not have a width
* some work to avoid blinking when window resizing
* add WM_PRINTCLIENT handling
This commit is contained in:
He Yang 2020-06-14 21:22:58 +08:00 committed by Mark Jansen
parent eacaf65459
commit fbf119fde1
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
11 changed files with 574 additions and 69 deletions

View file

@ -13,6 +13,8 @@
#include <atlcom.h>
#include <gdiplus.h>
HWND hMainWnd;
HINSTANCE hInst;
SETTINGS_INFO SettingsInfo;
@ -28,6 +30,10 @@ END_OBJECT_MAP()
CRAppsModule gModule;
CAtlWinModule gWinModule;
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
static VOID InitializeAtlModule(HINSTANCE hInstance, BOOL bInitialize)
{
if (bInitialize)
@ -40,6 +46,18 @@ static VOID InitializeAtlModule(HINSTANCE hInstance, BOOL bInitialize)
}
}
VOID InitializeGDIPlus(BOOL bInitialize)
{
if (bInitialize)
{
Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
}
else
{
Gdiplus::GdiplusShutdown(gdiplusToken);
}
}
VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo)
{
ATL::CStringW szDownloadDir;
@ -129,6 +147,7 @@ INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
BOOL bIsFirstLaunch;
InitializeAtlModule(hInstance, TRUE);
InitializeGDIPlus(TRUE);
if (GetUserDefaultUILanguage() == MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT))
{
@ -169,6 +188,7 @@ INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLi
if (hMutex)
CloseHandle(hMutex);
InitializeGDIPlus(FALSE);
InitializeAtlModule(hInstance, FALSE);
return 0;