Skip to content

Commit

Permalink
Fix dll error
Browse files Browse the repository at this point in the history
  • Loading branch information
hexadecimal233 committed Feb 8, 2021
1 parent 4035b9e commit c65aef4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Windows Store Downloader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<Prefer32Bit>true</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
Expand Down
30 changes: 15 additions & 15 deletions code/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -267,7 +267,7 @@ private void Form1_Paint(object sender, PaintEventArgs e)
rect = this.ClientRectangle;
}

if (IsWin7())
if (IsWinLess7())
{


Expand All @@ -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)
{
Expand Down

0 comments on commit c65aef4

Please sign in to comment.