Merge branch 'Dev'

This commit is contained in:
HeshamTB 2018-07-16 19:00:34 +03:00
commit 0e324143f1
5 changed files with 88 additions and 26 deletions

View File

@ -38,6 +38,7 @@
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.WinBut = new System.Windows.Forms.Button(); this.WinBut = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout(); this.SuspendLayout();
// //
// label1 // label1
@ -79,7 +80,7 @@
this.Wins.AutoSize = true; this.Wins.AutoSize = true;
this.Wins.Font = new System.Drawing.Font("Miriam Mono CLM", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(177))); this.Wins.Font = new System.Drawing.Font("Miriam Mono CLM", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(177)));
this.Wins.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); this.Wins.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.Wins.Location = new System.Drawing.Point(70, 75); this.Wins.Location = new System.Drawing.Point(75, 75);
this.Wins.Name = "Wins"; this.Wins.Name = "Wins";
this.Wins.Size = new System.Drawing.Size(40, 42); this.Wins.Size = new System.Drawing.Size(40, 42);
this.Wins.TabIndex = 3; this.Wins.TabIndex = 3;
@ -90,7 +91,7 @@
this.Losses.AutoSize = true; this.Losses.AutoSize = true;
this.Losses.Font = new System.Drawing.Font("Miriam Mono CLM", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(177))); this.Losses.Font = new System.Drawing.Font("Miriam Mono CLM", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(177)));
this.Losses.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.Losses.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.Losses.Location = new System.Drawing.Point(153, 73); this.Losses.Location = new System.Drawing.Point(130, 75);
this.Losses.Name = "Losses"; this.Losses.Name = "Losses";
this.Losses.Size = new System.Drawing.Size(40, 42); this.Losses.Size = new System.Drawing.Size(40, 42);
this.Losses.TabIndex = 4; this.Losses.TabIndex = 4;
@ -101,7 +102,7 @@
this.label3.AutoSize = true; this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Miriam Mono CLM", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(177))); this.label3.Font = new System.Drawing.Font("Miriam Mono CLM", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(177)));
this.label3.ForeColor = System.Drawing.Color.Black; this.label3.ForeColor = System.Drawing.Color.Black;
this.label3.Location = new System.Drawing.Point(116, 75); this.label3.Location = new System.Drawing.Point(112, 72);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(40, 42); this.label3.Size = new System.Drawing.Size(40, 42);
this.label3.TabIndex = 5; this.label3.TabIndex = 5;
@ -109,7 +110,7 @@
// //
// WinBut // WinBut
// //
this.WinBut.Location = new System.Drawing.Point(12, 87); this.WinBut.Location = new System.Drawing.Point(67, 132);
this.WinBut.Name = "WinBut"; this.WinBut.Name = "WinBut";
this.WinBut.Size = new System.Drawing.Size(52, 26); this.WinBut.Size = new System.Drawing.Size(52, 26);
this.WinBut.TabIndex = 6; this.WinBut.TabIndex = 6;
@ -119,7 +120,7 @@
// //
// button2 // button2
// //
this.button2.Location = new System.Drawing.Point(199, 89); this.button2.Location = new System.Drawing.Point(125, 132);
this.button2.Name = "button2"; this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(52, 26); this.button2.Size = new System.Drawing.Size(52, 26);
this.button2.TabIndex = 6; this.button2.TabIndex = 6;
@ -127,22 +128,36 @@
this.button2.UseVisualStyleBackColor = true; this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click); this.button2.Click += new System.EventHandler(this.button2_Click);
// //
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Miriam Mono CLM", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(177)));
this.label2.ForeColor = System.Drawing.Color.Black;
this.label2.Location = new System.Drawing.Point(103, 73);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(40, 42);
this.label2.TabIndex = 5;
this.label2.Text = ":";
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(263, 170); this.ClientSize = new System.Drawing.Size(263, 170);
this.Controls.Add(this.Wins);
this.Controls.Add(this.Losses);
this.Controls.Add(this.button2); this.Controls.Add(this.button2);
this.Controls.Add(this.WinBut); this.Controls.Add(this.WinBut);
this.Controls.Add(this.label2);
this.Controls.Add(this.label3); this.Controls.Add(this.label3);
this.Controls.Add(this.Losses);
this.Controls.Add(this.Wins);
this.Controls.Add(this.Time); this.Controls.Add(this.Time);
this.Controls.Add(this.status); this.Controls.Add(this.status);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.DoubleBuffered = true;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "Form1"; this.Name = "Form1";
this.Text = "Form1"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "OWTrack";
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -159,6 +174,7 @@
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button WinBut; private System.Windows.Forms.Button WinBut;
private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label2;
} }
} }

View File

@ -31,17 +31,24 @@ namespace OWTrack
private void checkStatus() private void checkStatus()
{ {
Time.Text = DateTime.Now.ToString("h:mm tt"); try
if (tr.owRunning()) {
{ Time.Text = DateTime.Now.ToString("h:mm tt");
status.Text = IS_RUNNING; if (tr.owRunning())
status.ForeColor = Color.FromArgb(128, 255, 128); {
} status.Text = IS_RUNNING;
else status.ForeColor = Color.FromArgb(128, 255, 128);
{ }
status.Text = NOT_RUNNING; else
status.ForeColor = Color.Red; {
} status.Text = NOT_RUNNING;
status.ForeColor = Color.Red;
}
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
} }
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)

View File

@ -11,6 +11,21 @@
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -40,11 +55,12 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
<Optimize>false</Optimize>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath> <OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize> <Optimize>false</Optimize>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
@ -99,5 +115,17 @@
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.6.1 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>

View File

@ -1,4 +1,5 @@
using System.Reflection; using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
@ -34,3 +35,5 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguage("")]

View File

@ -15,12 +15,20 @@ namespace OWTrack
{ {
} }
public bool owRunning() public bool owRunning()
{ {
bool isRunning = Process.GetProcessesByName("Overwatch") try
.FirstOrDefault(p => p.MainModule.FileName.StartsWith(@"D:\Hesham\installed Games\Overwatch")) != default(Process); {
return isRunning; bool isRunning = Process.GetProcessesByName("Overwatch")
.FirstOrDefault(p => p.MainModule.FileName.StartsWith(@"D:\Hesham\installed Games\Overwatch")) != default(Process);
return isRunning;
}
catch (Exception e)
{
Exception ex = new Exception("Error in tracking Overwatch.exe");
throw ex;
}
} }
public void addWin() { wins++; } public void addWin() { wins++; }