Skip to content

Commit

Permalink
代码改组,更新修复了几个小问题
Browse files Browse the repository at this point in the history
  • Loading branch information
imengyu committed Jan 29, 2019
1 parent fbb450e commit c9e6fd0
Show file tree
Hide file tree
Showing 65 changed files with 11,864 additions and 10,373 deletions.
Binary file modified Debug/PCMgr32.dll
Binary file not shown.
Binary file modified Debug/PCMgr32.exe
Binary file not shown.
12 changes: 6 additions & 6 deletions Debug/PCMgr32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ X32Warning=FALSE
MainGrouping=TRUE
ListSortIndex=0
ListSortDk=TRUE
OldSize=906-589
OldPos=258-125
OldSize=923-632
OldPos=127-137
OldIsMax=FALSE
MainHeaders=#TitleStatus-80#TitlePID-55#TitleProcName-170#TitleCPU-75#TitleRam-75#TitleDisk-75#TitleNet-75
MainHeaders1=239
ListStartsWidths=#200#225#200#100#200
ListUWPsWidths=#291#287#283
ListUsersWidths=#450#50#50#60
ListStartsWidths=
ListUWPsWidths=#300#260#260
ListUsersWidths=
ListDriversWidths=#154#100#87#81#190#90#46#128
ListServiceWidths=#113#52#173#65#99#67#62#180#85
OldSizeSimple=380-334
SimpleView=FALSE
OldSizeGraphic=640-320
OldSizeGraphic=0-0
DetalHeaders=TitleProcName-190#TitlePID-55#TitleStatus-55#TitleUserName-70#TitleCPU-60#TitleWorkingSetPrivate-70#TitleDescription-400#
DetalSort=0#Descending
[TopMost]
Expand Down
Binary file modified Debug/PCMgrApp32.dll
Binary file not shown.
Binary file modified Debug/PCMgrCmd32.dll
Binary file not shown.
Binary file modified Debug/PCMgrKernel32.dll
Binary file not shown.
Binary file modified Debug/en/PCMgrApp32.resource2.dll
Binary file not shown.
Binary file modified Debug/en/PCMgrApp32.resources.dll
Binary file not shown.
Binary file modified PCMgrCmdRunner/PCMgrCmdRunner.cpp
Binary file not shown.
1 change: 1 addition & 0 deletions PCMgrCmdRunner/PCMgrCmdRunnerEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CMD_CAPI(BOOL) MStartRunCmdThread();
CMD_CAPI(BOOL) MStopRunCmdThread();
CMD_CAPI(int) MAppCmdStart();

M_CMD_HANDLER(MRunCmd_Fix);
M_CMD_HANDLER(MRunCmd_TaskList);
M_CMD_HANDLER(MRunCmd_ScList);
M_CMD_HANDLER(MRunCmd_ScStop);
Expand Down
2 changes: 1 addition & 1 deletion PCMgrLoader/PCMgrLoader.vcxproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerDebuggerType>NativeOnly</LocalDebuggerDebuggerType>
<DebuggerFlavor>WindowsRemoteDebugger</DebuggerFlavor>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>
</LocalDebuggerCommandArguments>
<RemoteDebuggerServerName>192.168.116.130</RemoteDebuggerServerName>
Expand Down
34 changes: 34 additions & 0 deletions Release/PCMgr32.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[AppSetting]
Lanuage=zh
LastWindowTitle=ÈÎÎñ¹ÜÀíÆ÷
RefeshTime=Slow
MainGrouping=TRUE
ListSortIndex=0
ListSortDk=TRUE
OldSize=780-500
OldPos=327-199
OldIsMax=FALSE
MainHeaders=#TitleStatus-80#TitlePID-55#TitleProcName-170#TitleCPU-75#TitleRam-75#TitleDisk-75#TitleNet-75
MainHeaders1=200
ListStartsWidths=#200#200#200#100#200
ListUWPsWidths=#300#260#260
ListUsersWidths=#450#50#50#60
ListDriversWidths=#154#100#87#81#190#90#46#128
ListServiceWidths=#113#43#173#65#99#67#62#180#85
OldSizeSimple=380-334
SimpleView=FALSE
OldSizeGraphic=640-320
[TopMost]
AppSetting=FALSE
[CloseHideToNotfication]
AppSetting=FALSE
[MinHide]
AppSetting=FALSE
[MainGrouping]
AppSetting=FALSE
[AlwaysOnTop]
AppSetting=FALSE
[Configure]
RamPercentage=FALSE
DiskPercentage=FALSE
NetPercentage=FALSE
4 changes: 4 additions & 0 deletions TaskMgr/Ctls/PerformanceList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,12 @@ public class PerformanceListItem
{
public PerformanceListItem()
{
dataIem2 = new List<int>();
dataIem = new List<int>();
for (int i = 0; i < 30; i++)
Data.Add(0);
for (int i = 0; i < 30; i++)
Data2.Add(0);
Gray = false;
}

Expand All @@ -441,6 +444,7 @@ public Pen BasePen2
}
public string Name { get; set; }
public List<int> Data { get { return dataIem; } }
public List<int> Data2 { get { return dataIem2; } }

public object Tag { get; set; }

Expand Down
25 changes: 11 additions & 14 deletions TaskMgr/Ctls/PerformancePageCpu.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Diagnostics;
using PCMgr.Lanuages;
using static PCMgr.NativeMethods;

Expand Down Expand Up @@ -155,32 +152,32 @@ private void GetStaticInfos()
notDrawGrid = true;
}

performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem(LanuageMgr.GetStr("MaxSpeed"), MCpuInfoMonitor.GetCpuFrequency().ToString() + " MHz"));
performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem(LanuageMgr.GetStr("CpuCpunt"), cpuCount.ToString()));
performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem(LanuageMgr.GetStr("MaxSpeed", false), MCpuInfoMonitor.GetCpuFrequency().ToString() + " MHz"));
performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem(LanuageMgr.GetStr("CpuCpunt", false), cpuCount.ToString()));

if (MCpuInfoMonitor.GetCpuInfos())
{
performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem(LanuageMgr.GetStr("CpuPackageCount"), MCpuInfoMonitor.GetCpuPackage().ToString()));
performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem("L" + 1 + LanuageMgr.GetStr("Cache"), FormatFileSize1(Convert.ToInt32(MCpuInfoMonitor.GetCpuL1Cache()))));
performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem("L" + 2 + LanuageMgr.GetStr("Cache"), FormatFileSize1(Convert.ToInt32(MCpuInfoMonitor.GetCpuL2Cache()))));
if (MCpuInfoMonitor.GetCpuL3Cache() != 0) performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem("L" + 3 + LanuageMgr.GetStr("Cache"), FormatFileSize1(Convert.ToInt32(MCpuInfoMonitor.GetCpuL3Cache()))));
performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem(LanuageMgr.GetStr("CpuPackageCount", false), MCpuInfoMonitor.GetCpuPackage().ToString()));
performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem("L" + 1 + LanuageMgr.GetStr("Cache", false), FormatFileSize1(Convert.ToInt32(MCpuInfoMonitor.GetCpuL1Cache()))));
performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem("L" + 2 + LanuageMgr.GetStr("Cache", false), FormatFileSize1(Convert.ToInt32(MCpuInfoMonitor.GetCpuL2Cache()))));
if (MCpuInfoMonitor.GetCpuL3Cache() != 0) performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem("L" + 3 + LanuageMgr.GetStr("Cache", false), FormatFileSize1(Convert.ToInt32(MCpuInfoMonitor.GetCpuL3Cache()))));
}
}
private void InitRuntimeInfo()
{
item_cpuuseage = new PerformanceInfos.PerformanceInfoSpeicalItem();
item_cpuuseage.Name = LanuageMgr.GetStr("Useage");
item_cpuuseage.Name = LanuageMgr.GetStr("Useage", false);
item_cpuuseage_freq = new PerformanceInfos.PerformanceInfoSpeicalItem();
item_cpuuseage_freq.Name = "";
item_cpuuseage_freq.Value = " ";
item_process_count = new PerformanceInfos.PerformanceInfoSpeicalItem();
item_process_count.Name = FormMain.str_proc_count;
item_process_count.Name = LanuageMgr.GetStr("ProcessCount");
item_thread_count = new PerformanceInfos.PerformanceInfoSpeicalItem();
item_thread_count.Name = LanuageMgr.GetStr("ThreadCount");
item_thread_count.Name = LanuageMgr.GetStr("ThreadCount", false);
item_handle_count = new PerformanceInfos.PerformanceInfoSpeicalItem();
item_handle_count.Name = LanuageMgr.GetStr("HandleCount");
item_handle_count.Name = LanuageMgr.GetStr("HandleCount", false);
item_run_time = new PerformanceInfos.PerformanceInfoSpeicalItem();
item_run_time.Name = LanuageMgr.GetStr("RunTime");
item_run_time.Name = LanuageMgr.GetStr("RunTime", false);
performanceInfos.SpeicalItems.Add(item_cpuuseage);
performanceInfos.SpeicalItems.Add(item_cpuuseage_freq);
performanceInfos.SpeicalItems.Add(item_process_count);
Expand Down
20 changes: 10 additions & 10 deletions TaskMgr/Ctls/PerformancePageDisk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ public void PageUpdate()
ref read, ref write, ref avgque);

//下面的条目
item_readSpeed.Value = NativeMethods.FormatFileSize(Convert.ToInt64(readbytes)) + "/" + FormMain.str_sec;
item_writeSpeed.Value = NativeMethods.FormatFileSize(Convert.ToInt64(writebytes)) + "/" + FormMain.str_sec;
item_readSpeed.Value = NativeMethods.FormatFileSize(Convert.ToInt64(readbytes)) + "/" + LanuageFBuffers.Str_Second;
item_writeSpeed.Value = NativeMethods.FormatFileSize(Convert.ToInt64(writebytes)) + "/" + LanuageFBuffers.Str_Second;

item_responseTime.Value = avgque.ToString("0.0") + "%";

Expand All @@ -84,15 +84,15 @@ public void PageUpdate()
if (lastMaxSpeed > performanceGridSpeed.MaxValue)
{
performanceGridSpeed.MaxValue = GetSpeedMaxUnit();
performanceGridSpeed.RightText = NativeMethods.FormatFileSizeKBUnit(performanceGridSpeed.MaxValue) + "/" + FormMain.str_sec;
performanceGridSpeed.RightText = NativeMethods.FormatFileSizeKBUnit(performanceGridSpeed.MaxValue) + "/" + LanuageFBuffers.Str_Second;
}
else if (lastMaxSpeed < performanceGridSpeed.MaxValue)
{
int maxValue = GetSpeedMaxUnit();
if (performanceGridSpeed.MaxValue > maxValue)
{
performanceGridSpeed.MaxValue = maxValue;
performanceGridSpeed.RightText = NativeMethods.FormatFileSizeKBUnit(maxValue) + "/" + FormMain.str_sec;
performanceGridSpeed.RightText = NativeMethods.FormatFileSizeKBUnit(maxValue) + "/" + LanuageFBuffers.Str_Second;
}
}
//刷新最大速度标尺
Expand All @@ -101,7 +101,7 @@ public void PageUpdate()
&& lastMaxSpeed <= performanceGridSpeed.MaxValue * 0.95)
{
performanceGridSpeed.MaxScaleValue = lastMaxSpeed;
performanceGridSpeed.MaxScaleText = NativeMethods.FormatFileSizeKBUnit(lastMaxSpeed) + "/" + FormMain.str_sec;
performanceGridSpeed.MaxScaleText = NativeMethods.FormatFileSizeKBUnit(lastMaxSpeed) + "/" + LanuageFBuffers.Str_Second;
}
else performanceGridSpeed.MaxScaleValue = 0;

Expand Down Expand Up @@ -176,17 +176,17 @@ private void InitValues()
item_writeSpeed.Name = LanuageMgr.GetStr("WriteSpeed");
item_readSpeed.DrawFrontLine = true;
item_readSpeed.FrontLineIsDotted = true;
item_readSpeed.FrontLineColor = FormMain.DiskDrawColor;
item_readSpeed.FrontLineColor = Main.MainPagePerf.DiskDrawColor;
item_writeSpeed.DrawFrontLine = true;
item_writeSpeed.FrontLineColor = FormMain.DiskDrawColor;
item_writeSpeed.FrontLineColor = Main.MainPagePerf.DiskDrawColor;

performanceInfos.FontTitle = new Font("Microsoft YaHei UI", 9);
performanceInfos.SpeicalItems.Add(item_diskTime);
performanceInfos.SpeicalItems.Add(item_responseTime);
performanceInfos.SpeicalItems.Add(item_readSpeed);
performanceInfos.SpeicalItems.Add(item_writeSpeed);

performanceGridSpeed.RightText = NativeMethods.FormatFileSizeKBUnit(lastMaxSpeed) + "/" + FormMain.str_sec;
performanceGridSpeed.RightText = NativeMethods.FormatFileSizeKBUnit(lastMaxSpeed) + "/" + LanuageFBuffers.Str_Second;
performanceGridSpeed.MaxValue = 100;
performanceGridSpeed.DrawData2 = true;
}
Expand All @@ -204,8 +204,8 @@ private void InitStaticValues()
size = UInt64.Parse(stringBuilderSize.ToString());
performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem(LanuageMgr.GetStr("Capacity"), NativeMethods.FormatFileSizeKBUnit(Convert.ToInt64(size / 1024))));
performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem(LanuageMgr.GetStr("Formatted"), NativeMethods.FormatFileSizeKBUnit(Convert.ToInt64(size / 1024))));
performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem(LanuageMgr.GetStr("IsSystemDir"), MDEVICE_GetIsSystemDisk(currDiskName) ? FormMain.str_Yes : FormMain.str_No));
performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem(LanuageMgr.GetStr("PageFile"), MDEVICE_GetIsPageFileDisk(currDiskName) ? FormMain.str_Yes : FormMain.str_No));
performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem(LanuageMgr.GetStr("IsSystemDir"), MDEVICE_GetIsSystemDisk(currDiskName) ? LanuageMgr.GetStr("Yes") : LanuageMgr.GetStr("No")));
performanceInfos.StaticItems.Add(new PerformanceInfos.PerformanceInfoStaticItem(LanuageMgr.GetStr("PageFile"), MDEVICE_GetIsPageFileDisk(currDiskName) ? LanuageMgr.GetStr("Yes") : LanuageMgr.GetStr("No")));

performanceTitle1.SmallTitle = stringBuilderName.ToString();
}
Expand Down
22 changes: 13 additions & 9 deletions TaskMgr/Ctls/PerformancePageNet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public bool PageUpdateSimple(out string customString, out int outdata1, out int
performanceGrid.AddData((int)(lastReceive / 1024 * 8));
}

customString = FormMain.str_Sent + " : " + (lastSent / 1024 * 8).ToString("0.0") + " "
+ FormMain.str_Receive + " : " + (lastReceive / 1024 * 8).ToString("0.0") + " Kbps";
customString = LanuageMgr.GetStr("Send") + " " + (lastSent / 1024 * 8).ToString("0.0") + " "
+ LanuageMgr.GetStr("Receive") + " " + (lastReceive / 1024 * 8).ToString("0.0") + " Kbps";
outdata1 = (int)(lastSent * 0.0001);
outdata2 = (int)(lastReceive * 0.0001);
return true;
Expand All @@ -118,17 +118,17 @@ public void PageInit()
item_readSpeed = new PerformanceInfos.PerformanceInfoSpeicalItem();
item_writeSpeed = new PerformanceInfos.PerformanceInfoSpeicalItem();
item_writeSpeed.LineSp = true;
item_readSpeed.Name = FormMain.str_Sent;
item_writeSpeed.Name = FormMain.str_Receive;
item_readSpeed.Name = LanuageMgr.GetStr("Send");
item_writeSpeed.Name = LanuageMgr.GetStr("Receive");
item_readSpeed.DrawFrontLine = true;
item_readSpeed.FrontLineColor = FormMain.NetDrawColor;
item_readSpeed.FrontLineColor = Main.MainPagePerf.NetDrawColor;
item_readSpeed.FrontLineIsDotted = true;
item_writeSpeed.DrawFrontLine = true;
item_writeSpeed.FrontLineColor = FormMain.NetDrawColor;
item_writeSpeed.FrontLineColor = Main.MainPagePerf.NetDrawColor;

performanceGrid.MaxValue = 100;
performanceGrid.DrawData2 = true;
performanceGrid.MaxUnitPen = new Pen(FormMain.NetDrawColor);
performanceGrid.MaxUnitPen = new Pen(Main.MainPagePerf.NetDrawColor);

performanceInfos.FontTitle = new Font("Microsoft YaHei UI", 9);
performanceInfos.SpeicalItems.Add(item_readSpeed);
Expand Down Expand Up @@ -163,9 +163,13 @@ private int GetSpeedMaxUnit()
return 5120;//5m
if (lastMaxSpeed < 10300)
return 10240;//10m
if (lastMaxSpeed < 103000)
if (lastMaxSpeed < 20500)
return 20480;//20m
if (lastMaxSpeed < 51000)
return 51200;//50m
if (lastMaxSpeed < 103400)
return 102400;//100m
if (lastMaxSpeed < 513000)
if (lastMaxSpeed < 520000)
return 512000;//500m
else return 1048576;//1g
}
Expand Down
12 changes: 6 additions & 6 deletions TaskMgr/Ctls/PerformanceRamPoolGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public PerformanceRamPoolGrid()
{
SetStyle(ControlStyles.Selectable, false);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
BgBrush = new SolidBrush(FormMain.RamBgColor);
DrawPen = new Pen(FormMain.RamDrawColor);
BgBrush = new SolidBrush(Main.MainPagePerf.RamBgColor);
DrawPen = new Pen(Main.MainPagePerf.RamDrawColor);
GridPen = new Pen(Color.FromArgb(206, 176, 215));
TextBrush = new SolidBrush(Color.Gray);
stringFormatRight = new StringFormat();
Expand Down Expand Up @@ -157,7 +157,7 @@ protected override void OnPaint(PaintEventArgs e)
g.DrawLine(DrawPen, w, r.Top, w, r.Bottom);
if (w > 100)
{
g.DrawString(FormMain.str_MemUsingS, Font, TextBrush, 0, Height - TopTextHeight + BottomTextOffestY);
g.DrawString(Lanuages.LanuageMgr.GetStr("MemUsingS"), Font, TextBrush, 0, Height - TopTextHeight + BottomTextOffestY);
g.DrawString(StrVauleUsing, Font, TextBrush, rectInUse, stringFormatCenter);
}
}
Expand All @@ -174,7 +174,7 @@ protected override void OnPaint(PaintEventArgs e)
g.DrawLine(DrawPen, w, r.Top, w, r.Bottom);

if (rectInUse.Width > 100)//右
g.DrawString(FormMain.str_MemModifed, Font, TextBrush, new Rectangle(rectInUse.X, Height - TopTextHeight + BottomTextOffestY, rectInUse.Width + rectModified.Width, TopTextHeight), stringFormatRight);
g.DrawString(Lanuages.LanuageMgr.GetStr("MemModifed"), Font, TextBrush, new Rectangle(rectInUse.X, Height - TopTextHeight + BottomTextOffestY, rectInUse.Width + rectModified.Width, TopTextHeight), stringFormatRight);
if (w - oldw > 50)
g.DrawString(StrVauleModified, Font, TextBrush, rectModified, stringFormatCenter);
}
Expand All @@ -191,7 +191,7 @@ protected override void OnPaint(PaintEventArgs e)
g.DrawLine(DrawPen, w, r.Top, w, r.Bottom);

if (w - oldw > 50)
g.DrawString(FormMain.str_MemStandby, Font, TextBrush, oldw, Height - TopTextHeight + BottomTextOffestY);
g.DrawString(Lanuages.LanuageMgr.GetStr("MemStandby"), Font, TextBrush, oldw, Height - TopTextHeight + BottomTextOffestY);
if (w - oldw > 50)
g.DrawString(StrVauleStandby, Font, TextBrush, rectStandby, stringFormatCenter);

Expand All @@ -204,7 +204,7 @@ protected override void OnPaint(PaintEventArgs e)
w += (int)(VauleFree * Width);
rectFree = new Rectangle(oldw, r.Top, w - oldw, r.Height);
if (rectStandby.Width > 50)//右
g.DrawString(FormMain.str_MemFree, Font, TextBrush, new Rectangle(rectStandby.X, Height - TopTextHeight + BottomTextOffestY, rectStandby.Width + rectFree.Width, TopTextHeight), stringFormatRight);
g.DrawString(Lanuages.LanuageMgr.GetStr("MemFree"), Font, TextBrush, new Rectangle(rectStandby.X, Height - TopTextHeight + BottomTextOffestY, rectStandby.Width + rectFree.Width, TopTextHeight), stringFormatRight);
if (w - oldw > 50)
g.DrawString(StrVauleFree, Font, TextBrush, rectFree, stringFormatCenter);

Expand Down
Loading

0 comments on commit c9e6fd0

Please sign in to comment.