From be58a11b4e9e70dce81e52aae4aa98904dcd794b Mon Sep 17 00:00:00 2001 From: joten Date: Wed, 13 Apr 2016 18:48:37 +0200 Subject: [PATCH] fixed bugs related to issue #95 --- src/Bar.ahk | 6 ++++-- src/ResourceMonitor.ahk | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Bar.ahk b/src/Bar.ahk index 8bed1e8..32b5047 100644 --- a/src/Bar.ahk +++ b/src/Bar.ahk @@ -445,12 +445,14 @@ Bar_updateStatus() { GuiControl, , Bar_#%m%_volume_highlighted, %vol% GuiControl, , Bar_#%m%_volume, % " VOL: " SubStr(" " vol, -2) "% " } - If Config_readinDate + If Config_readinDate { FormatTime, time, , % Config_readinDateFormat GuiControl, , Bar_#%m%_date, % time - If Config_readinTime + } + If Config_readinTime { FormatTime, time, , % Config_readinTimeFormat GuiControl, , Bar_#%m%_time, % time + } } } diff --git a/src/ResourceMonitor.ahk b/src/ResourceMonitor.ahk index 98e0a2b..a452d3d 100644 --- a/src/ResourceMonitor.ahk +++ b/src/ResourceMonitor.ahk @@ -75,6 +75,7 @@ ResourceMonitor_getDiskLoad(ByRef readLoad, ByRef writeLoad) { Global ResourceMonitor_hDrive Static oldReadCount, oldWriteCount + nReturn := oldReadCount := oldWriteCount := 0 dpSize := 5 * 8 + 4 + 4 + 4 + 4 + 8 + 4 + 8 * (A_IsUnicode ? 2 : 1) + 12 ;; 88? VarSetCapacity(dp, dpSize) DllCall("DeviceIoControl", "UInt", ResourceMonitor_hDrive, "UInt", 0x00070020, "UInt", 0, "UInt", 0, "UInt", &dp, "UInt", dpSize, "UIntP", nReturn, "UInt", 0) ;; IOCTL_DISK_PERFORMANCE @@ -119,6 +120,7 @@ ResourceMonitor_getSystemTimes() { Static oldIdleTime, oldKrnlTime, oldUserTime Static newIdleTime, newKrnlTime, newUserTime + newIdleTime := newKrnlTime := newUserTime := 0 oldIdleTime := newIdleTime oldKrnlTime := newKrnlTime oldUserTime := newUserTime