Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hexadecimal233 committed Feb 6, 2021
1 parent e466771 commit 723b980
Show file tree
Hide file tree
Showing 16 changed files with 205 additions and 61 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# do not upload resource files
resource/*





## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
Expand Down
10 changes: 10 additions & 0 deletions Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,8 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="store" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\store.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
13 changes: 8 additions & 5 deletions Windows Store Downloader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>resource\icon.ico</ApplicationIcon>
<ApplicationIcon>resources\icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
Expand Down Expand Up @@ -159,10 +159,13 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="resource\icon.ico" />
</ItemGroup>
<ItemGroup>
<Folder Include="resource\img\" />
<Content Include="resources\icon.ico" />
<None Include="resources\store.png" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
6 changes: 6 additions & 0 deletions Windows Store Downloader.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B41BB8C5-767D-46E3-99D1-D6B7ECC144A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B41BB8C5-767D-46E3-99D1-D6B7ECC144A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B41BB8C5-767D-46E3-99D1-D6B7ECC144A6}.Debug|x64.ActiveCfg = Debug|x64
{B41BB8C5-767D-46E3-99D1-D6B7ECC144A6}.Debug|x64.Build.0 = Debug|x64
{B41BB8C5-767D-46E3-99D1-D6B7ECC144A6}.Debug|x86.ActiveCfg = Debug|Any CPU
{B41BB8C5-767D-46E3-99D1-D6B7ECC144A6}.Debug|x86.Build.0 = Debug|Any CPU
{B41BB8C5-767D-46E3-99D1-D6B7ECC144A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B41BB8C5-767D-46E3-99D1-D6B7ECC144A6}.Release|Any CPU.Build.0 = Release|Any CPU
{B41BB8C5-767D-46E3-99D1-D6B7ECC144A6}.Release|x64.ActiveCfg = Release|x64
{B41BB8C5-767D-46E3-99D1-D6B7ECC144A6}.Release|x64.Build.0 = Release|x64
{B41BB8C5-767D-46E3-99D1-D6B7ECC144A6}.Release|x86.ActiveCfg = Release|Any CPU
{B41BB8C5-767D-46E3-99D1-D6B7ECC144A6}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
75 changes: 47 additions & 28 deletions code/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 52 additions & 2 deletions code/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using System.Drawing.Drawing2D;
using System.Runtime.InteropServices;

namespace Windows_Store_Downloader
{
Expand Down Expand Up @@ -71,10 +73,16 @@ private void DownloadButton_Click(object sender, EventArgs e)
downloadButton.Enabled = false;
Form2.complete = false;
progressBar1.Value = 0;
if (typeBox.SelectedIndex == -1 || routeBox.SelectedIndex == -1 || langText.Text == "" || attributeText.Text == "")
if (typeBox.SelectedIndex == -1 || routeBox.SelectedIndex == -1 || attributeText.Text == "")
{
MessageBox.Show(Language.lang_baddown,Language.lang_baddowninfo,MessageBoxButtons.OK,MessageBoxIcon.Error);
} else {
}
else
{
if (langText.Text == "")
{
langText.Text = System.Threading.Thread.CurrentThread.CurrentCulture.Name;
}
postContent = "type=" + Http_Post.type[typeBox.SelectedIndex] + "&url=" + attributeText.Text + "&ring=" +
Http_Post.ring[routeBox.SelectedIndex] + "&lang=" + langText.Text;

Expand All @@ -92,6 +100,7 @@ private void DownloadButton_Click(object sender, EventArgs e)
}
progressBar1.Value = 100;
downloadButton.Enabled = true;
new Form2().ShowDialog();
}

}
Expand All @@ -108,6 +117,19 @@ private void ChangeLanguage(object sender, EventArgs e)

private void Form1_Load(object sender, EventArgs e)
{


User32.AnimateWindow(this.Handle, 1000, User32.AW_BLEND | User32.AW_ACTIVE | User32.AW_VER_NEGATIVE);

Bitmap a = Properties.Resources.store;
a.MakeTransparent(Color.FromArgb(0, 255, 0));
pictureBox1.BackgroundImage = a;
if (System.Diagnostics.Debugger.IsAttached != true)
{
langText.Visible = false;
langPackText.Visible = false;
}

WriteToTemp.ReadFrom();
if (System.Threading.Thread.CurrentThread.CurrentCulture.Name == "zh-CN") {
Chinese_Lang();
Expand Down Expand Up @@ -158,5 +180,33 @@ private void RefreshText(object sender, EventArgs e)
textBoxHasText = true;
}
}

private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
User32.AnimateWindow(this.Handle, 1000, User32.AW_BLEND | User32.AW_HIDE);
}
}
class User32
{
/// <summary>
/// 窗体动画函数
/// </summary>
/// <param name="hwnd">指定产生动画的窗口的句柄</param>
/// <param name="dwTime">指定动画持续的时间</param>
/// <param name="dwFlags">指定动画类型,可以是一个或多个标志的组合。</param>
/// <returns></returns>
[DllImport("user32")]
public static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags);

//下面是可用的常量,根据不同的动画效果声明自己需要的
public const int AW_HOR_POSITIVE = 0x0001;//自左向右显示窗口,该标志可以在滚动动画和滑动动画中使用。使用AW_CENTER标志时忽略该标志
public const int AW_HOR_NEGATIVE = 0x0002;//自右向左显示窗口,该标志可以在滚动动画和滑动动画中使用。使用AW_CENTER标志时忽略该标志
public const int AW_VER_POSITIVE = 0x0004;//自顶向下显示窗口,该标志可以在滚动动画和滑动动画中使用。使用AW_CENTER标志时忽略该标志
public const int AW_VER_NEGATIVE = 0x0008;//自下向上显示窗口,该标志可以在滚动动画和滑动动画中使用。使用AW_CENTER标志时忽略该标志该标志
public const int AW_CENTER = 0x0010;//若使用了AW_HIDE标志,则使窗口向内重叠;否则向外扩展
public const int AW_HIDE = 0x10000;//隐藏窗口
public const int AW_ACTIVE = 0x20000;//激活窗口,在使用了AW_HIDE标志后不要使用这个标志
public const int AW_SLIDE = 0x40000;//使用滑动类型动画效果,默认为滚动动画类型,当使用AW_CENTER标志时,这个标志就被忽略
public const int AW_BLEND = 0x80000;//使用淡入淡出效果
}
}
Loading

0 comments on commit 723b980

Please sign in to comment.