--- In [email protected], "konfes99" <konfe...@...> wrote:
> 
> Oh my God, thank you Bruce and Sheri, it works perfectly.
> 
> One more thing Sheri, I just noticed that F2 is now broken in
> QDir (portable file manager which has same class name as windows
> explorer), so how should I exclude Q-Dir.exe in the script? 

The F2 hotkey target of filedialog,=Explorer was not subjecting Q-dir to the 
script! Therefore, Q-dir's own hotkey processing was conflicting with 
Powerpro's. It still didn't work even if hotkeys were turned off with 
Exec.Hotkeys("off"). As long as there was an F2 hotkey defined for Powerpro, it 
conflicted with Q-dir. Therefore the only option was to take over processing F2 
for Q-dir. That made it more complicated than I had wanted to take on, but I 
did get it to work.

The hotkey target should now be filedialog,=explorer,=Q-Dir

Modify the script. Replace everything above the line "static lasthwnd" with the 
following:

local hwnd=win.getfocus
if (win.class(hwnd)=="SyslistView32") do
  local LVM_GETEDITCONTROL=0x00001018
  LOCAL LVM_FIRST=0x1000
  local LVM_EDITLABELA=LVM_FIRST + 23
  local LVM_EDITLABELW=LVM_FIRST + 118
  local LVNI_SELECTED=0x0002
  local LVM_GETNEXTITEM=LVM_FIRST + 12
  local choice=win.sendmessage(hwnd, LVM_GETNEXTITEM, -1, ;;+
LVNI_SELECTED)
  win.sendmessage(hwnd, LVM_EDITLABELW, choice, 0)
  local ctrlhwnd=win.sendmessage(hwnd, LVM_GETEDITCONTROL, 0, 0)
  hwnd=ctrlhwnd
  win.setfocus(hwnd)
  wait.for(60)
elseif (win.class(hwnd)!=="edit")
  win.sendkeys("{sinp}{F2}")
endif

hwnd=win.getfocus
if (win.class(hwnd)!=="edit")
  quit
;end of insertion, next line is static lasthwnd

If you discover conflicts with other apps file managers you could try making 
the hotkey even more inclusive by using a target of 
filedialog,=explorer,c=SyslistView32

Regards,
Sheri

Reply via email to