ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: Allow commenting of files in directory listing

<< < (5/6) > >>

IainB:
@MilesAhead:
Where I said:
This shell integration worked fine in XP but does not yet work in my Win7 (64-bit). I intend to figure out how to fix this
-IainB (August 23, 2011, 04:34 PM)
--- End quote ---
- is your view that it cannot be fixed because the dll is a 32-bit one and needs to be made compatible with the OS as a 64-bit one?

By the way, what you have done re the AHK function looks very intereresting. Thankyou. I shall try it out.
I am using AutoHotkey_L latest version (64-bit).

MilesAhead:
To use 32 bit shell extensions on 64 bit OS you have to access via either a 32 bit file manager, such as FreeCommander etc., or the 32 bit Explorer.  Microsoft had a work-around.  They stored a 32 bit Explorer under SysWow64 folder.  If you launched it, most 32 bit shell extensions would work. That's why I wrote HalfShell hotkey app.  My 32 bit shell extensions, and other peoples, were working kick ass on Vista64.  Then I got word from people they weren't working on 64 bit W7.  Turns out, as I mentioned earlier, that the hard link was no longer guaranteed to go to a 32 bit Explorer.  Basically MS shot themselves in the foot but the bullet went through everyone using the work-around.

Maybe 64 bit compiler sales were slow since the 32 bit shell extensions were working? ;)

I'm updating my AHK doodad.  I've used the key/comment text data file for years.  But I never stress tested it with a lot of data.  If somebody could add some more efficient or robust data storage that would be a big bonus.  For simplicity I'm back to using the entire file path as key. In my TipOff program I only use the file name part with a comment file in each folder.  Probably not so necessary now since we seem to be back to the OS wanting to be on C: with Vista and W7. So the drive letter thing is less likely to break it.

A little more work and I'll post what I have for working AHK prototype.

MilesAhead:
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

MilesAhead:
Ok, I have a working app uploaded to my site. See this post for particulars:

https://www.donationcoder.com/forum/index.php?topic=27756.msg259555#msg259555

Instead of writing the comment file on program exit, I use the same trick I did on my shell extension.  Append new comment to the file.  On load dupes are replaced in the dictionary with the newest entry.

There are Compact and Purge commands in the Tray Menu to remove dupes and dead entries(the file was renamed or deleted/moved etc..)

edit: I wrote a small dummy file and comment generator to write 5000 temp files and comments.  It took a bit of time to write out the file so not a good choice to have the entire file written on program close.  That's why I changed to the append technique I mentioned above.  But the Purge and Compact commands seemed to work fine with progress bar(if 100 or more entries are in the dictionary.)  As a safeguard I use a flag to note when the comment file is being manipulated for any lengthy functions. The program Quit Command won't quit if the file access is busy(unless you log out or stop task with task manager or something.)  In any case it should take quite awhile to build up 5000 comments in normal usage.  Therefore I think this Hotkey approach is OK for manual use.


edit2: also note while file purge or compaction is going on the hotkeys are temporarily suspended.  You shouldn't even notice unless you try to use the hotkeys while the progress bar is updating. On my system 5000 dummy entries were processed in about 4 or 5 seconds so it shouldn't be an issue.

MilesAhead:
The latest version of Comment Explorer is pretty usable now.  Only shows ToolTip if there's a comment.  It's shown at top left of window.  Time out for the ToolTip is adjustable via .ini file.

One thing I didn't like about my shell extension was waiting for mouse hover time to show the ToolTip.  By using Arrow Keys as trigger, the response time is nearly instant.
Also it's not dependent on Windows file types.  A comment can be entered for files of any type and folders.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version