Here's my current version. Initial testing seems ok.
To Toggle Arrow Keys enabled just double click Tray Icon. Shows status in icon tooltip.
CommentExplorer.ahk
/*
* * * Compile_AHK SETTINGS BEGIN * * *
[AHK2EXE]
Exe_File=%In_Dir%\CommentExplorer.exe
No_UPX=1
[VERSION]
Set_Version_Info=1
File_Version=1.0.0.0
Inc_File_Version=0
Product_Version=1.0.0.0
[ICONS]
Icon_1=%In_Dir%\C.ico
* * * Compile_AHK SETTINGS END * * *
*/
#SingleInstance ignore
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#Include MilesAhead.ahk
progname := _FileBaseName(A_ScriptFullPath)
tiptext := progname . " ==> No"
Menu Tray,NoStandard
Menu Tray,Add,Donate,DoDonate
Menu Tray,Add,Visit Hotkey Page,DoVisit
Menu Tray,Add,About,DoAbout
Menu Tray,Add
Menu Tray,Add,Arrow ToolTips,ToggleTips
Menu Tray,Add
Menu Tray,Add,Quit,DoQuit
Menu Tray,Default,Arrow ToolTips
if (A_IsCompiled)
Menu Tray,Icon,%A_ScriptFullPath%,1
Menu Tray,Tip,%tiptext%
ArrowsEnabled := 0
IniFile = %A_ScriptDir%\%A_ScriptName%
IniFile := RegExReplace(IniFile,"i)ahk$","ini")
IniFile := RegExReplace(IniFile,"i)exe$","ini")
IniRead,ArrowsOn,%IniFile%,Settings,ArrowsEnabled,1
if ArrowsOn
gosub,ToggleTips
GroupAdd,ExplorerGroup, ahk_class CabinetWClass
GroupAdd,ExplorerGroup, ahk_class ExploreWClass
TipActive := 0
FileName := ""
CommentFile := "Comments.txt"
sd := ComObjCreate("Scripting.Dictionary")
gosub,ReadCommentFile
#IfWinActive, ahk_Group ExplorerGroup
~Up::
~Down::
if !ArrowsEnabled
Return
if TipActive
gosub,ClearTip
Clipboard= ; clear clipboard
Send ^c
ClipWait,0
if sd.exists(Clipboard)
{
str := sd.item(Clipboard)
ToolTip,%str%
}
else
ToolTip,%Clipboard%
TipActive := 1
SetTimer,ClearTip,-4000
Return
+F11::
Clipboard= ; clear
Send ^c
ClipWait,0
FileName := Clipboard
str := ""
if sd.exists(FileName)
str := sd.item(FileName)
InputBox,Comment,,Enter Comment,,,,,,,,%str%
if ErrorLevel
Return
sd.item(FileName) := Comment
Return
ClearTip:
if TipActive
{
ToolTip
TipActive := 0
}
Return
ReadCommentFile:
IfNotExist,%CommentFile%
Return
FileRead,Contents,%CommentFile%
if Contents=
Return
Loop, parse, Contents, `n, `r
{
if Mod(A_Index,2)
keystr := A_LoopField
else
sd.item(keystr) := A_LoopField
}
Return
ToggleTips:
ArrowsEnabled := !ArrowsEnabled
Menu Tray,ToggleCheck,Arrow ToolTips
if ArrowsEnabled
tiptext := progname . " ==> Yes"
else
tiptext := progname . " ==> No"
Menu Tray,Tip,%tiptext%
Return
DoAbout:
FileGetVersion,filever,%progname%.exe
MyMsg =
(
%progname% v %filever% Copyright (c) 2011 www.FavesSoft.com`n
Use Up Down Arrows to see Comments in Explorer`n
Press Shift-F11 to Add Comment for a File`n
)
MsgBox, 4160, About %progname%, %MyMsg%
Return
DoDonate:
Run,"http://www.favessoft.com/donate.html"
Return
DoVisit:
Run,"http://www.favessoft.com/hotkeys.html"
Return
DoQuit:
IniWrite,%ArrowsEnabled%,%IniFile%,Settings,ArrowsEnabled
IfExist,%CommentFile%
FileDelete,%CommentFile%
for k, v in sd.Keys()
{
if sd.exists(k)
{
FileAppend,%k%`n,%CommentFile%
str := sd.item(k)
FileAppend,%str%`n,%CommentFile%
}
}
sd := 0
ExitApp