Skip to content

Commit 0f5169d

Browse files
authored
Add files via upload
1 parent d32d8b2 commit 0f5169d

File tree

14 files changed

+763
-0
lines changed

14 files changed

+763
-0
lines changed

CpuTrayApp.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.14.36301.6 d17.14
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CpuTrayApp", "CpuTrayApp\CpuTrayApp.csproj", "{B003172C-9577-4AC7-A022-9225432A3072}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{B003172C-9577-4AC7-A022-9225432A3072}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{B003172C-9577-4AC7-A022-9225432A3072}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{B003172C-9577-4AC7-A022-9225432A3072}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{B003172C-9577-4AC7-A022-9225432A3072}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {BBCBFE70-83B8-4029-8DD2-08A043098523}
24+
EndGlobalSection
25+
EndGlobal

CpuTrayApp/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
5+
</startup>
6+
</configuration>

CpuTrayApp/CpuTrayApp.csproj

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{B003172C-9577-4AC7-A022-9225432A3072}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>CpuTrayApp</RootNamespace>
10+
<AssemblyName>CpuTrayApp</AssemblyName>
11+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
<TargetFrameworkProfile />
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<PlatformTarget>AnyCPU</PlatformTarget>
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\Debug\</OutputPath>
23+
<DefineConstants>DEBUG;TRACE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<PlatformTarget>AnyCPU</PlatformTarget>
29+
<DebugType>pdbonly</DebugType>
30+
<Optimize>true</Optimize>
31+
<OutputPath>bin\Release\</OutputPath>
32+
<DefineConstants>
33+
</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>0</WarningLevel>
36+
<Prefer32Bit>false</Prefer32Bit>
37+
<PreferNativeArm64>false</PreferNativeArm64>
38+
</PropertyGroup>
39+
<PropertyGroup>
40+
<ApplicationIcon>favicon.ico</ApplicationIcon>
41+
</PropertyGroup>
42+
<PropertyGroup>
43+
<StartupObject>CpuTrayApp.Program</StartupObject>
44+
</PropertyGroup>
45+
<PropertyGroup />
46+
<PropertyGroup />
47+
<PropertyGroup>
48+
<ApplicationManifest>app.manifest</ApplicationManifest>
49+
</PropertyGroup>
50+
<ItemGroup>
51+
<Reference Include="System" />
52+
<Reference Include="System.Core" />
53+
<Reference Include="System.Management" />
54+
<Reference Include="System.Xml.Linq" />
55+
<Reference Include="System.Data.DataSetExtensions" />
56+
<Reference Include="Microsoft.CSharp" />
57+
<Reference Include="System.Data" />
58+
<Reference Include="System.Deployment" />
59+
<Reference Include="System.Drawing" />
60+
<Reference Include="System.Net.Http" />
61+
<Reference Include="System.Windows.Forms" />
62+
<Reference Include="System.Xml" />
63+
</ItemGroup>
64+
<ItemGroup>
65+
<Compile Include="MemoryCleaner.cs" />
66+
<Compile Include="Program.cs" />
67+
<Compile Include="Properties\AssemblyInfo.cs" />
68+
<Compile Include="Tray.cs" />
69+
<EmbeddedResource Include="Properties\Resources.resx">
70+
<Generator>ResXFileCodeGenerator</Generator>
71+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
72+
<SubType>Designer</SubType>
73+
</EmbeddedResource>
74+
<Compile Include="Properties\Resources.Designer.cs">
75+
<AutoGen>True</AutoGen>
76+
<DependentUpon>Resources.resx</DependentUpon>
77+
<DesignTime>True</DesignTime>
78+
</Compile>
79+
<None Include="app.manifest" />
80+
<None Include="Properties\Settings.settings">
81+
<Generator>SettingsSingleFileGenerator</Generator>
82+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
83+
</None>
84+
<Compile Include="Properties\Settings.Designer.cs">
85+
<AutoGen>True</AutoGen>
86+
<DependentUpon>Settings.settings</DependentUpon>
87+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
88+
</Compile>
89+
</ItemGroup>
90+
<ItemGroup>
91+
<None Include="App.config" />
92+
</ItemGroup>
93+
<ItemGroup>
94+
<Content Include="favicon.ico" />
95+
</ItemGroup>
96+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
97+
</Project>

CpuTrayApp/MemoryCleaner.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Diagnostics;
3+
using System.Runtime.InteropServices;
4+
5+
class MemoryCleaner
6+
{
7+
[DllImport("psapi.dll")]
8+
private static extern bool EmptyWorkingSet(IntPtr hProcess);
9+
10+
public static void CleanCurrentProcessMemory()
11+
{
12+
Process proc = Process.GetCurrentProcess();
13+
EmptyWorkingSet(proc.Handle); // Attempts to free RAM back to Windows
14+
}
15+
}

CpuTrayApp/Program.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Windows.Forms;
3+
4+
namespace CpuTrayApp
5+
{
6+
internal static class Program
7+
{
8+
/// <summary>
9+
/// The main entry point for the application.
10+
/// </summary>
11+
[STAThread]
12+
static void Main()
13+
{
14+
Application.EnableVisualStyles();
15+
Application.SetCompatibleTextRenderingDefault(false);
16+
17+
// Create and initialize the tray
18+
Tray tray = new Tray();
19+
tray.InitializeTray();
20+
21+
// Run the app with the tray (no form is shown)
22+
Application.Run();
23+
}
24+
}
25+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System.Reflection;
2+
using System.Runtime.InteropServices;
3+
4+
// General Information about an assembly is controlled through the following
5+
// set of attributes. Change these attribute values to modify the information
6+
// associated with an assembly.
7+
[assembly: AssemblyTitle("CpuTrayApp")]
8+
[assembly: AssemblyDescription("")]
9+
[assembly: AssemblyConfiguration("")]
10+
[assembly: AssemblyCompany("")]
11+
[assembly: AssemblyProduct("CpuTrayApp")]
12+
[assembly: AssemblyCopyright("Copyright © 2025")]
13+
[assembly: AssemblyTrademark("")]
14+
[assembly: AssemblyCulture("")]
15+
16+
// Setting ComVisible to false makes the types in this assembly not visible
17+
// to COM components. If you need to access a type in this assembly from
18+
// COM, set the ComVisible attribute to true on that type.
19+
[assembly: ComVisible(false)]
20+
21+
// The following GUID is for the ID of the typelib if this project is exposed to COM
22+
[assembly: Guid("b003172c-9577-4ac7-a022-9225432a3072")]
23+
24+
// Version information for an assembly consists of the following four values:
25+
//
26+
// Major Version
27+
// Minor Version
28+
// Build Number
29+
// Revision
30+
//
31+
[assembly: AssemblyVersion("1.0.0.0")]
32+
[assembly: AssemblyFileVersion("1.0.0.0")]

CpuTrayApp/Properties/Resources.Designer.cs

Lines changed: 73 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)