Figured out that it was a unicode character. Unfortunately, it doesn't exist on the box this runs on (Win7) so I just replaced it with a + instead.
I saw the graph test, so figured I'd add it to the menu items and fix the issue. Works fine now, though I've tweaked my version a touch.
Updated Host Monitor.ahk context menu to add the item to it, and updated the contextmenuhandler to handle it. I like what you've done with that, by the way.
Also, here's the updated pinggraph.ahk:
Code: Select all
#SingleInstance, Force
#NoEnv
ListLines, Off
;<===== Startup =============================================================>
;Receive messages from slave scripts
OnMessage(0x4a, "Receive_WM_COPYDATA")
;Allcate console so we don't have constant flashing windows while pinging
DllCall("AllocConsole")
WinHide % "ahk_id " DllCall("GetConsoleWindow", "ptr")
;<===== User Input ==========================================================>
;InputBox, host,, Input hostname or IP to monitor.
host = %1%
;<===== GUI =================================================================>
Gui, Margin, 10, 10
Gui, Font, s8, Verdana
Loop, % 11 + ( Y := 15 ) - 15 ; Loop 11 times (create X axis labels)
Gui, Add, Text, xm y%y% w22 h10 0x200 Right, % 125 - (Y += 10)
ColumnW := 10
hBM := XGraph_MakeGrid( ColumnW, 10, 40, 12, 0x008000, 0, GraphW, GraphH )
Gui, Add, Text, % "xm+25 ym w" ( GraphW + 2 ) " h" ( GraphH + 2 ) " 0x1000" ; SS_SUNKEN := 0x1000
Gui, Add, Text, xp+1 yp+1 w%GraphW% h%GraphH% hwndhGraph1 0xE, pGraph1
pGraph1 := XGraph( hGraph1, hBM, ColumnW, "1,10,0,10", 0x00FF00, 1, True )
Gui, Add, StatusBar
SB_SetParts( 35 )
Gui, Show,, XGraph Ping %host%
Loop, 100
XGraph_Plot(pGraph1, A_Index)
SetTimer, Ping, 1000
Return
;<===== Hotkeys =============================================================>
F1::XGraph_Info(pGraph1)
;<===== Labels ==============================================================>
GuiClose:
ExitApp
Ping:
Run, % A_ScriptDir . "\inc\PingMsg.ahk """ . A_ScriptName . """ "
. host . " " . A_Index,, Hide, threadID
Return
;<===== Functions ===========================================================>
Receive_WM_COPYDATA(wParam, lParam){
Global
StringAddress := NumGet(lParam + 2*A_PtrSize)
CopyOfData := StrGet(StringAddress)
reply := StrSplit(CopyOfData, "|")
if (reply[3] != "TIMEOUT")
{
;Good return
XGraph_Plot(pGraph1, 100-strReplace(reply[3], "ms"))
SB_SetText( reply[3], 2 )
;ToolTip, % strReplace(reply[3], "ms")
} else {
;Timeout
XGraph_Plot(pGraph1, 9999)
SB_SetText( reply[3], 2 )
}
return true
}
;<===== Includes ============================================================>
#Include %A_ScriptDir%\inc
#Include Common Functions.ahk
#Include XGraph.ahk