diff --git a/AppInstaller/AppInstaller.rc b/AppInstaller/AppInstaller.rc
index 07c6505..94f51f8 100644
--- a/AppInstaller/AppInstaller.rc
+++ b/AppInstaller/AppInstaller.rc
@@ -114,8 +114,8 @@ IDR_MANIFEST1 RT_MANIFEST "res/manifest.xml"
//
IDR_VERSION_ZH_CN VERSIONINFO
- FILEVERSION 1,0,1,9
- PRODUCTVERSION 1,0,1,9
+ FILEVERSION 1,0,1,10
+ PRODUCTVERSION 1,0,1,10
FILEFLAGSMASK 0x0L
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -132,9 +132,9 @@ BEGIN
BEGIN
VALUE "CompanyName", "Bruce Winter"
VALUE "FileDescription", "应用安装程序"
- VALUE "FileVersion", "1.0.1.9"
+ VALUE "FileVersion", "1.0.1.10"
VALUE "LegalCopyright", "\\xA9Bruce Winter. All rights reserved."
- VALUE "ProductVersion", "1.0.1.9"
+ VALUE "ProductVersion", "1.0.1.10"
END
END
BLOCK "VarFileInfo"
@@ -144,8 +144,8 @@ BEGIN
END
IDR_VERSION_EN_US VERSIONINFO
- FILEVERSION 1,0,1,9
- PRODUCTVERSION 1,0,1,9
+ FILEVERSION 1,0,1,10
+ PRODUCTVERSION 1,0,1,10
FILEFLAGSMASK 0x0L
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -162,9 +162,9 @@ BEGIN
BEGIN
VALUE "CompanyName", "Bruce Winter"
VALUE "FileDescription", "App Installer"
- VALUE "FileVersion", "1.0.1.9"
+ VALUE "FileVersion", "1.0.1.10"
VALUE "LegalCopyright", "\\xA9Bruce Winter. All rights reserved."
- VALUE "ProductVersion", "1.0.1.9"
+ VALUE "ProductVersion", "1.0.1.10"
END
END
BLOCK "VarFileInfo"
diff --git a/AppInstaller/app.manifest b/AppInstaller/app.manifest
index 1672455..b1039e4 100644
--- a/AppInstaller/app.manifest
+++ b/AppInstaller/app.manifest
@@ -1,17 +1,26 @@
-
-
-
-
-
+
+
+
+
+
-
+
-
-
+
+
+
+
+
+
+ True/PM
+
+
+
\ No newline at end of file
diff --git a/AppInstaller/mainwnd.cpp b/AppInstaller/mainwnd.cpp
index 899e15d..e25d2a6 100644
--- a/AppInstaller/mainwnd.cpp
+++ b/AppInstaller/mainwnd.cpp
@@ -29,6 +29,7 @@ using namespace System;
using namespace System::Windows::Forms;
using namespace System::Threading;
using namespace msclr::interop;
+using namespace System::Runtime::InteropServices;
int GetScreenWidth ()
{
@@ -44,6 +45,9 @@ int GetScreenHeight ()
#define toBool(_String_Managed_Object_) Boolean::Parse (_String_Managed_Object_)
#define toDateTime(_String_Managed_Object_) DateTime::Parse (_String_Managed_Object_)
+extern int iDpi = GetDPI ();
+extern double dDpi = iDpi * 0.01;
+
String ^GetRCString_NET (UINT resID)
{
size_t bufferSize = 256;
@@ -206,9 +210,6 @@ void SetWebBrowserEmulation ()
System::Runtime::InteropServices::Marshal::FreeHGlobal (appNamePtr);
}
-#include
-#include
-
bool IsIeVersion10 ()
{
HKEY hKey;
@@ -335,44 +336,27 @@ void OutputDebugStringFormatted (const wchar_t* format, ...);
public ref class AppWindow: public Form
{
private:
- WebBrowser ^webUI;
+ System::Windows::Forms::WebBrowser ^webUI;
std::vector *appItems = new std::vector ();
System::Collections::Generic::Dictionary ^jsFunctionHandlers;
public:
AppWindow ()
{
this->Visible = false;
- BOOL transitionsEnabled = FALSE;
- HRESULT hr = DwmSetWindowAttribute (
- reinterpret_cast (this->Handle.ToPointer ()),
- DWMWA_TRANSITIONS_FORCEDISABLED,
- &transitionsEnabled,
- sizeof (transitionsEnabled)
- );
- DWMNCRENDERINGPOLICY dwmplc = DWMNCRP_ENABLED;
- hr = DwmSetWindowAttribute (
- reinterpret_cast (this->Handle.ToPointer ()),
- DWMWA_NCRENDERING_POLICY,
- &dwmplc,
- sizeof (dwmplc)
- );
- MARGINS margins = {-1, -1, -1, -1};
- hr = DwmExtendFrameIntoClientArea (
- reinterpret_cast (this->Handle.ToPointer ()),
- &margins
- );
+ this->DoubleBuffered = true;
jsFunctionHandlers = gcnew System::Collections::Generic::Dictionary ();
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::None;
this->ShowInTaskbar = false;
this->TopMost = true;
- this->Size = System::Drawing::Size (392, 494);
- if (IsWindows10AndLater ()) this->MinimumSize = System::Drawing::Size (392, 226);
- else this->MinimumSize = System::Drawing::Size (392, 129);
- if (IsWindows10AndLater ()) this->MaximumSize = System::Drawing::Size (392, 522);
- else this->MaximumSize = System::Drawing::Size (368, 394);
+ this->Size = System::Drawing::Size (392 * dDpi, 494 * dDpi);
+ if (IsWindows10AndLater ()) this->MinimumSize = System::Drawing::Size (392 * dDpi, 226 * dDpi);
+ else this->MinimumSize = System::Drawing::Size (392 * dDpi, 129 * dDpi);
+ if (IsWindows10AndLater ()) this->MaximumSize = System::Drawing::Size (392 * dDpi, 522 * dDpi);
+ else this->MaximumSize = System::Drawing::Size (368 * dDpi, 394 * dDpi);
this->Text = rcString (APPLIST_WINTITLE);
- webUI = gcnew WebBrowser ();
+ webUI = gcnew System::Windows::Forms::WebBrowser ();
webUI->Dock = DockStyle::Fill;
+ webUI->Visible = false;
this->Controls->Add (webUI);
String ^rootDir = System::IO::Path::GetDirectoryName (System::Windows::Forms::Application::ExecutablePath);
String ^htmlFilePath = System::IO::Path::Combine (rootDir, "HTML\\Libs\\AppList.html");
@@ -387,6 +371,7 @@ public ref class AppWindow: public Form
}
void OnDocumentCompleted (Object ^sender, WebBrowserDocumentCompletedEventArgs ^e)
{
+ this->CallJSFunction ("SetHighDpiMode", gcnew array