双击判断是否选中文件

;ahk_l版
;用于win7
;如果是xp的话,只需要第一段,且把判断条件修改下即可
SetTitleMatchMode, RegEx
GroupAdd, Explorer, ahk_class CabinetWClass
GroupAdd, Explorer, ahk_class ExploreWClass

GroupAdd, desktop, ahk_class Progman
GroupAdd, desktop, ahk_class WorkerW

WaitTime := DllCall("GetDoubleClickTime")/1000
ComObjError(0)
return

#IfWinActive, ahk_group desktop
~LButton::
   KeyWait,LButton
   KeyWait, LButton, d T%WaitTime%
   If ! Errorlevel
   {
      MouseGetPos,,,,myCtrl,1
      ControlGet, selected, List, Selected Col1, %myCtrl%, A
      if !selected
         Run notepad.exe
   }
   Return


#IfWinActive, ahk_group Explorer
~LButton::
   KeyWait,LButton
   KeyWait, LButton, d T%WaitTime%
   If ! Errorlevel
   {
      selected:=ShellFolder()
      if !selected
         Run notepad.exe
   }
   Return
#IfWinActive

ShellFolder(hWnd=0)
{

   If   hWnd || (hWnd :=   WinExist("ahk_class (?:Cabinet|Explore)WClass"))
   {
      For window in ComObjCreate("Shell.Application").Windows
         doc :=   window.document
      Until   (window.hWnd = hWnd)
      sFolder :=   doc.folder.self.path, sFocus :=   doc.focuseditem.name
      For item in doc.selecteditems
         sSelect .=   (!sSelect ? "" : "`n") item.name
      Return   sSelect
   }
}

给TA捐赠
共{{data.count}}人
人已捐赠
其他

双击ALT弹出快捷操作,输入命令

2020-3-9 1:43:44

其他案例

双击触发热键示例

2020-3-9 1:45:44

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索