From c65aef4e0da63fee3df6659bb1bc8acd83292e09 Mon Sep 17 00:00:00 2001
From: 2593828650 <2593828650@qq.com>
Date: Mon, 8 Feb 2021 16:28:21 +0800
Subject: [PATCH] Fix dll error
---
Windows Store Downloader.csproj | 2 +-
code/Form1.cs | 30 +++++++++++++++---------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/Windows Store Downloader.csproj b/Windows Store Downloader.csproj
index f1a2c41..9306f8c 100644
--- a/Windows Store Downloader.csproj
+++ b/Windows Store Downloader.csproj
@@ -47,7 +47,7 @@
TRACE
prompt
4
- false
+ true
true
diff --git a/code/Form1.cs b/code/Form1.cs
index 662d3a3..0d4e8d8 100644
--- a/code/Form1.cs
+++ b/code/Form1.cs
@@ -163,7 +163,7 @@ private void Form1_Load(object sender, EventArgs e)
English_Lang();
langBox.SelectedIndex = 0;
}
- if (IsWin7())
+ if (IsWinLess7())
{
CloseButton.ForeColor = Color.DodgerBlue;
User32.AnimateWindow(this.Handle, 200, User32.AW_BLEND | User32.AW_ACTIVE | User32.AW_VER_NEGATIVE);
@@ -174,20 +174,11 @@ private void Form1_Load(object sender, EventArgs e)
{
this.TransparencyKey = Color.FromArgb(0xf1f1f0);//R不等于B
RefreshForm();
- SetBlur1(this.Handle, 0x3FFFFFFF);//亚克力效果
+ Acrylic.SetBlur(this.Handle, 0x3FFFFFFF);//亚克力效果
}//WIN10亚克力
}
- private void SetBlur1(IntPtr hWnd,int gradientColor)
- {
- if (File.Exists("acrylic.dll") == false)
- {
- MessageBox.Show("acrylic.dll not found.Please put the dll to current directory." +
- "\n无法找到acrylic.dll。请把它放到当前目录。");
- Environment.Exit(0);
- }
- Acrylic.SetBlur(hWnd, gradientColor);
- }//容错dll
+
private void Chinese_Lang()
{
Language.Chinese_Lang();
@@ -228,7 +219,7 @@ private void RefreshText(object sender, EventArgs e)//刷新文本
private void Form1_FormClosed(object sender, FormClosedEventArgs e)//淡出
{
- if (IsWin7())
+ if (IsWinLess7())
{
this.Opacity = 1;
User32.AnimateWindow(this.Handle, 300, User32.AW_BLEND | User32.AW_HIDE);
@@ -237,6 +228,15 @@ private void Form1_FormClosed(object sender, FormClosedEventArgs e)//淡出
}
private void RefreshForm()//初始化窗口
{
+ if (IsWinLess7())
+ {
+ if (File.Exists("acrylic.dll") == false)
+ {
+ MessageBox.Show("acrylic.dll not found.Please put the dll to current directory." +
+ "\n无法找到acrylic.dll。请把它放到当前目录。");
+ Environment.Exit(0);
+ }
+ }//容错dll
Bitmap a = Properties.Resources.store;
a.MakeTransparent(Color.FromArgb(0, 255, 0));//透明图片
pictureBox1.BackgroundImage = a;
@@ -267,7 +267,7 @@ private void Form1_Paint(object sender, PaintEventArgs e)
rect = this.ClientRectangle;
}
- if (IsWin7())
+ if (IsWinLess7())
{
@@ -284,7 +284,7 @@ private void Form1_Paint(object sender, PaintEventArgs e)
private bool forceWin7 = false;//强制win7透明
- private bool IsWin7()
+ private bool IsWinLess7()
{
if (forceWin7)
{